我上傳了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)
我已經加入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'
我該如何解決這個問題?如何解決類未找到異常?
至於
在谷歌搜索'OutOfMemoryError'和'ClassNotFoundException' –
是因爲,我在我的清單dexOptions { javaMaxHeapSize 「4G」 }? – SKB
nope。對於第二個例外,添加'multiDexEnabled' –