Getting Exception java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions after updating to the new firebase
This worked for me:
- If you haven't already, update your 'Google Play Services' to Revision 30 from Android SDK Manager > Extras.
And then add the line
compile 'com.android.support:multidex:1.0.1'
to your dependancies (or simply removemultiDexEnabled true
if not required)Add this attribute to the application tag in manifest:
android:name="android.support.multidex.MultiDexApplication"
If you already have a custom application class defined in Android Manifest, extend it fromMultiDexApplication
instead ofApplication
Hope it helped!
Android Firebase NoClassDefFoundError: com.google.firebase.FirebaseOptions after updating to the new firebase
In your case
Remove this dependency from your build.gradle
file
compile 'com.google.android.gms:play-services:9.4.0'
and Add separate one like this
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
this should solve your problem.
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
Thanks for posting the question Sanket. I'm the PM on Firebase Test Lab (formerly Cloud Test Lab). Wanted to let you know that this is a bug on our end that should now be fixed.
It seems that your app is currently using the latest and greatest Google Play Services. We updated our devices to use them last week then we discovered a bug that had us revert to an older version. Right now, we re-deployed the latest Play services on our devices so rerunning your tests should work. If not, please let me know and we'll look into it and fix it.
Android NoClassDefFoundError: com.google.firebase.FirebaseOptions
first update your Google Repository
in your sdk
second 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'
Firebase Admin NoClassDefFoundError: FirebaseOptions$Builder
The problem turned out to be that I was using this command to build:
gradlew clean install
However, the Jar generated by that doesn't contain the dependencies. And the Firebase Admin SDK is a dependency.
So what I did is I used shadowJar, which generates a Jar that contains dependencies. Unlike gradlew clean install
.
Then, in the Procfile, I set it to the Jar that shadowJar generates. The only problem I see to have is, now I have to go to IntelliJ and run the shadowJar from there, since there doesn't seem any command to run it from the commandline.
Hope this helps
Related Topics
How to Convert an Image into a Base64 String
The Apk Must Be Signed With the Same Certificates as the Previous Version
How to Support Different Screen Size in Android
Horizontalscrollview Within Scrollview Touch Handling
Detect Network Connection Type on Android
How to Adjust Text Font Size to Fit Textview
How Can an App Detect That It's Going to Be Uninstalled
Converting a View to Bitmap Without Displaying It in Android
Custom Listview Adapter With Filter Android
Determine If Running on a Rooted Device
How to Pause/Sleep Thread or Process in Android
Sending Images Using Http Post
Getapplication() Vs. Getapplicationcontext()
Difference Between Activity Context and Application Context
Android: How to Get the Current Foreground Activity (From a Service)
How to Assign an Id to a View Programmatically