本文介绍了Android NoClassDefFoundError:com.google.firebase.FirebaseOptions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行我的代码时,Adroid studio会给出该错误。
我的gradle文件就像下面这样,Android Studio v2.2 gradle是'com.android.tools.build :gradle:2.2.0-alpha1'
apply plugin:'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion23.0.2
packagingOptions {
排除'META-INF / DEPENDENCIES'
}
defaultConfig {
applicationIdcom.asd.asd
minSdkVersion 14
targetSdkVersion 23
versionCode 9
versionName1.3.4
multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android .txt'),'proguard-rules.txt'
}
}
dexOptions {
javaM axHeapSize4g
jumboMode true
preDexLibraries false
}
}
依赖关系{
compile project(':mPChartLib')
compile fileTree(dir:'libs',include:['* .jar'])
testCompile'junit:junit:4.12'
compile'com.android.support:appcompat-v7:23.1 .1'
compile'com.google.code.gson:gson:2.3.1'
编译文件('libs / commons-httpclient-3.1.jar')
编译文件(' 'libs / signpost-commonshttp4-1.2.1.2.jar')
编译文件('libs / signpost-core-1.2.1.2.jar')
编译文件('libs / pushwoosh-4.0.4。 jar')
编译文件('libs / httpcore-4.4.4.jar')
编译文件('libs / httpclient-4.5.2.jar')
编译'com.google .android.gms:play-services:9.0.0'
}
05-30 20:41:50.785 14551-14551 / com.asd.asd / AndroidRuntime:致命例外:主进程:com.asd.asd,PID:14551
com.google.firebase.FirebaseApp.zzbu(未知源代码)
java.lang.NoClassDefFoundError:com.google.firebase.FirebaseOptions
在com.google.firebase.provider.FirebaseInitProvider.onCreate(未知源)
在android.content.ContentProvider.attachInfo(ContentProvider.java:1638)
在android.content.ContentProvider.attachInfo(ContentProvider。 java:1609)
,位于com.google.firebase.provider.FirebaseInitProvider.attachInfo(U n知道源)
在android.app.ActivityThread.installProvider(ActivityThread.java:5008)
在android.app.ActivityThread.installContentProviders(ActivityThread.java:4582)
在android.app。在android.app.ActivityThread.access
(ActivityThread.java:151)
at android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1381) )
在android.os.Handler.dispatchMessage(Handler.java:110)
在android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native方法)
在java.lang.reflect.Method.invoke(Method.java:515)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
idont使用任何firebase应用程序,但是我得到了这个呃ROR。所以我尝试在网上找到的somany tecnique。但注意到变化。
你能帮我解答吗?
在您的sdk中更新您的
Google Repository
第二个启用 multidex
像 defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName1.0
multiDexEnabled true
使用
compile'com.android.support:multidex:1.0.1'
classpath'com.google.gms:google-services:3.0.0'
When i run my codes Adroid studio gives that error
my gradle file like under below and Android Studio v2.2 gradle is 'com.android.tools.build:gradle:2.2.0-alpha1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
defaultConfig {
applicationId "com.asd.asd"
minSdkVersion 14
targetSdkVersion 23
versionCode 9
versionName "1.3.4"
multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode true
preDexLibraries false
}
}
dependencies {
compile project(':mPChartLib')
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.code.gson:gson:2.3.1'
compile files('libs/commons-httpclient-3.1.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/pushwoosh-4.0.4.jar')
compile files('libs/httpcore-4.4.4.jar')
compile files('libs/httpclient-4.5.2.jar')
compile 'com.google.android.gms:play-services:9.0.0'
}
05-30 20:41:50.785 14551-14551/com.asd.asd/AndroidRuntime: FATAL EXCEPTION: main Process: com.asd.asd, PID: 14551
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1638)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1609)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5008)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4582)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
idont use any firebase application but i got this error. so i try somany tecnique which are found on internet . but noting change .
can you help me pls
解决方案
first update your Google Repository
in your sdksecond enable multidex
like
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
compile with
compile 'com.android.support:multidex:1.0.1'
classpath 'com.google.gms:google-services:3.0.0'
这篇关于Android NoClassDefFoundError:com.google.firebase.FirebaseOptions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!