未知的崩溃报告

时间:2017-07-10 07:33:43

标签: android android-fragments out-of-memory crash-reports

我在Play商店上传了一个应用。我看到以下崩溃报告:

java.lang.RuntimeException: 
  at android.app.ActivityThread.installProvider(ActivityThread.java:5045)
  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4616)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)
  at android.app.ActivityThread.access$1500(ActivityThread.java:154)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1408)
  at android.os.Handler.dispatchMessage(Handler.java:110)
  at android.os.Looper.loop(Looper.java:193)
  at android.app.ActivityThread.main(ActivityThread.java:5328)
  at java.lang.reflect.Method.invokeNative(Native Method:0)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:654)
  at dalvik.system.NativeStart.main(Native Method:0)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
  at android.app.ActivityThread.installProvider(ActivityThread.java:5030)

另一份报告:

java.lang.OutOfMemoryError:
 at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
  at com.unss.packo.apptest.seven_contact.onCreateView(seven_contact.java:43)

我已经为我的Build Gradle添加了multidex支持。我的Build.gradle如下:

 defaultConfig {
        applicationId "com.unss.pramod.bindumadhava"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 5
        versionName "1.1.2"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    // volley
    // Glide
    compile 'com.android.support:appcompat-v7:24.0.2'
    //compile 'com.android.support:appcompat-v7:26.0.0'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.google.android.gms:play-services:9.6.0'
    compile 'com.google.firebase:firebase-messaging:9.6.0'
    compile 'com.google.android.gms:play-services-ads:9.6.0'
    compile 'com.google.android.gms:play-services-auth:9.6.0'
    compile 'com.google.android.gms:play-services-gcm:9.6.0'
}
apply plugin: 'com.google.gms.google-services'

我该如何解决这个问题?如何解决未发现的类异常?

关于

1 个答案:

答案 0 :(得分:0)

为你的课程找不到:

将此添加到gradle.build:

defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...

// Enabling multidex support.
multiDexEnabled true
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

和outofmemory错误: 将此添加到menifest文件的应用程序标记...

android:largeHeap="true"

在此之后添加您的应用程序标记似乎是

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">

要在运行时查询可用的内存大小,请使用方法getMemoryClass()或getLargeMemoryClass()。

...谢谢