WISHY WISHY - 4 months ago 71
Android Question

NoClassDefFoundError FirebaseOptions, android?

I am getting this exception when I run my app on the device.

java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.zzeh(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1214)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1189)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4990)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4596)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4536)
at android.app.ActivityThread.access$1300(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5214)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)


I am not even using the Firebase API still it is somehow getting reference.

This is my app gradle file

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.1"

defaultConfig {
applicationId "com.supe.supermax"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.github.gcacace:signature-pad:1.1.0'
compile project(':ViewPagerIndicator')
}


How do I fix it?

Answer

Version conflicting .

You should use Stable version 9.0.0 instead of 9.2.1

compile 'com.google.android.gms:play-services:9.0.0'

And Add multidex

compile 'com.android.support:multidex:1.0.1'

Hope this help .

Comments