I have been facing following crash with Room stable version when proguard is enabled
FATAL EXCEPTION: main
Process: <mypackage>.debug, PID: 27841
java.lang.RuntimeException: Unable to create application <mypackage>.DebugBaseApplication: java.lang.RuntimeException: cannot find implementation for <mypackage>.database.c. c_Impl does not exist
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5015)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1573)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5811)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
Caused by: java.lang.RuntimeException: cannot find implementation for <mypackage>.database.c. c_Impl does not exist
at android.a.c.b.d.a(Unknown Source)
at android.a.c.b.e$a.b(Unknown Source)
at <mypackage>.database.c.getFuelDatabase(Unknown Source)
at <mypackage>.database.b.init(Unknown Source)
at <mypackage>.c.onCreate(Unknown Source)
at <mypackage>.DebugBaseApplication.onCreate(Unknown Source)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1041)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5012)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1573)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5811)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
Here is my proguard configuration for room
## Room
-dontwarn android.arch.util.paging.CountedDataSource
-dontwarn android.arch.persistence.room.paging.LimitOffsetDataSource
Here are how dependencies are being declared in build.gradle
// room for local cache
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
implementation "android.arch.persistence.room:rxjava2:1.0.0"
I have gone through many stackoverflow posts regarding this. Like
Room Persistence Library run time exception when calling Rooms inMemoryBuilder method
and Room cannot find implementation but thing is I am not using Kotlin and everything seems correctly configured to me. I am not sure whats the problem here please suggest.
Related
Recently we started to get crashes (Firebase Crashlytics) that appear to be originating from Glide, we could not find any visible reason in our app that causes it and the stack trace points to Glide. please have a look at the attached StackTrace.
Any help will be greatly appreciated.
We do have custom implementation for the following classes:
AppGlideModule
DataFetcher
ModelLoader
but for URL fetching, we use Glide's GlideUrl which is the Glide Default.
build.gradle:
def glide_version = "4.11.0"
implementation "com.github.bumptech.glide:glide:$glide_version"
implementation "com.github.bumptech.glide:annotations:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
StackTrace:
Fatal Exception: com.bumptech.glide.load.engine.cache.util.LicenseCheckError$LicenseServiceError: Error when calling licensing service
at com.bumptech.glide.load.engine.cache.util.LicenseClient.callLicenseCheckV2Method(LicenseClient.java:136)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.checkLicenseInternal(LicenseClient.java:119)
at com.bumptech.glide.load.engine.cache.util.LicenseClient$LicenseServiceConnection.onServiceConnected(LicenseClient.java:162)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2037)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2069)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by android.os.DeadObjectException
at android.os.BinderProxy.transactNative(BinderProxy.java)
at android.os.BinderProxy.transact(BinderProxy.java:526)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.callLicenseCheckV2Method(LicenseClient.java:129)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.checkLicenseInternal(LicenseClient.java:119)
at com.bumptech.glide.load.engine.cache.util.LicenseClient$LicenseServiceConnection.onServiceConnected(LicenseClient.java:162)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2037)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2069)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Edit:
this is not a "regular" DeadObjectException as it comes from within the Glide library that tries to access an internal LicenseCheckError class
08-17 06:27:52.494 8079-8079/? E/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(SourceFile:739)
at com.google.firebase.FirebaseApp.zze(SourceFile:705)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:328)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:294)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:281)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:37)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1759)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1734)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:31)
at android.app.ActivityThread.installProvider(ActivityThread.java:6420)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5951)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.NoSuchMethodError: No virtual method zzbqp()Ljava/lang/String; in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.setting.noshairamjad7.wallpaper-1/base.apk)
at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(SourceFile:739)
at com.google.firebase.FirebaseApp.zze(SourceFile:705)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:328)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:294)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:281)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:37)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1759)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1734)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:31)
at android.app.ActivityThread.installProvider(ActivityThread.java:6420)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5951)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
08-17 06:27:53.881 8079-8079/com.setting.noshairamjad7.wallpaper E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.setting.noshairamjad7.wallpaper, PID: 8079
here is gradle it's my first post so sorry if not properlyposted
Try this:
1.You should never include this dependency! It brings in all of the play-services-{x} libraries into your app at once. Just remove this line
compile 'com.google.android.gms:play-services:9.0.0'
Could you try updating dependencies to a later version? That means change all the 25.3.1 dependencies to 26.0.1 or 27.0.0 and all the 9.0.0 dependencies to 11.4.2 or 11.6.0.
it helps you
A simple solution is that use Fireabase Assistant to initialize the Firebase in your application
First remove all firebase dependency and apply plugin: 'com.google.gms.google-services' from your app gradle ( in Android Studio 2.3.3) follow this step
Tools > Firebase
(On right tab) Assistant > Authentication
Caused by: java.lang.NoSuchMethodError: No virtual method zzbqp()Ljava/lang/String; in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.setting.noshairamjad7.wallpaper-1/base.apk)
at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
A missing ProGuard rule ?
https://firebase.google.com/docs/database/android/start/
After implementing Facebook Account Kit and run project it shows Firebase API initialization failure as
FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5257)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4808)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4748)
at android.app.ActivityThread.access$1700(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
And also getting Null Pointer Exception from AccountKitController as
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.PackageManager android.content.Context.getPackageManager()' on a null object reference
at com.facebook.accountkit.internal.Initializer.initialize(Initializer.java:101)
at com.facebook.accountkit.internal.AccountKitController.initialize(AccountKitController.java:601)
at com.facebook.accountkit.internal.AccountKitInitProvider.onCreate(AccountKitInitProvider.java:31)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
at android.app.ActivityThread.installProvider(ActivityThread.java:5257)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4808)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4748)
at android.app.ActivityThread.access$1700(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
Using Account kit gradle as
compile 'com.facebook.android:account-kit-sdk:4.27.0'
And Firebase Gradle as
compile 'com.google.firebase:firebase-messaging:11.0.4'
Note : Removing Account Kit from project its working fine i.e. there is no Firebase API initialization failure. issue. Therefore it's sure that there is conflict in firebase and Account kit SDK (:
This is caused by Facebook's SDK being packaged with a different version of the GMS library than what is packaged with Firebase's. You can do something like this to get back up and running:
compile ('com.facebook.android:account-kit-sdk:4.27.0') {
exclude group: 'com.google.android.gms', module: 'play-services-auth-api-phone'
exclude group: 'com.google.android.gms', module: 'play-services-auth'
}
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
What this does is essentially hot-swaps out the older library for the newer one packaged with Firebase. It tells Facebook to compile without the old libs and then we make sure they are added back in with newer version right after.
For NullPointerException exception it seems that, Application is not initialized first, Content Providers are initialized before it.
And in Facebook account kit SDK's code it was trying to get my application context.
Now the problem was, I did implement method getApplicationContext() in application class that is getting application shared variable but that variable was setting globally and Facebook Account Kit sdk code getting Null application context.
Solution : setting shared variable in onCreate method instead of setting globally it resolved the problem of Unable to get provider.
And For Mixing issue, Account Kit SDK use 11.0.1 version for play services gradle and in my project I am having 11.0.4 that is actually not the issue because on compile time gradle takes latest gradle but In my project I am not referring below gradle which Facebook Account Kit SDK is using.
compile 'com.google.android.gms:play-services-auth-api-phone:11.0.1'
Solution : I have added above gradle with version 11.0.4 and the mixing gradle issue has been resolved.
compile 'com.google.android.gms:play-services-auth-api-phone:11.0.4'
And as suggested by #astryk if I exclude play-services-auth-api-phone module then gradle mixing error is not showing but it is not including that module becasue in AccountKitActivity on next button click my application crashes as
Crash Report Thread:main Exception:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/phone/SmsRetriever;
at com.facebook.accountkit.internal.PhoneLoginController.createSmsToken(PhoneLoginController.java:250)
at com.facebook.accountkit.internal.PhoneLoginController.logIn(PhoneLoginController.java:188)
at com.facebook.accountkit.internal.LoginManager.logInWithPhoneNumber(LoginManager.java:372)
at com.facebook.accountkit.internal.AccountKitController.logInWithPhoneNumber(AccountKitController.java:631)
at com.facebook.accountkit.ui.PhoneLoginFlowManager.logInWithPhoneNumber(PhoneLoginFlowManager.java:57)
at com.facebook.accountkit.ui.ActivityPhoneHandler.onPhoneLoginComplete(ActivityPhoneHandler.java:189)
at com.facebook.accountkit.ui.AccountKitActivity$1.onReceive(AccountKitActivity.java:176)
at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.phone.SmsRetriever" on path: DexPathList[[zip file "/data/app/com.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.myappList item -1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 16 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.auth.api.phone.SmsRetriever
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available`
I need both Firebase Cloud Messaging and Nearby support in my app.
The latest allowed Nearby version is 9.0.0. So, I have to use following dependencies:
//Firebase
compile ‘com.google.firebase:firebase-core:9.0.0'
compile ‘com.google.firebase:firebase-messaging:9.0.0'
//Nearby
compile ‘com.google.android.gms:play-services-nearby::9.0.0’
It compiles successfully but when I try to get Firebase instance app crashes with IllegalAccessError:
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:114)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.firebase.iid.zzg' (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.obolus.poc.customer-1/base.apk)
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
Using of different versions for these components causes compile error. Firebase 10.0.1 without Nearby works fine but I need both.
How can I solve this issue?
Thanks.
Solution
Perhaps it's a bug but for now to ensure that play-services plugin will check available versions correctly place line
apply plugin: 'com.google.gms.google-services'
at the bottom of your build.gradle file (below the dependencies block).
Check out https://firebase.google.com/docs/android/setup#add_the_sdk
I think you are wrong the latest nearby is v10 the same as Firebase
use the following dependencies that are here under
com.google.android.gms:play-services-nearby:10.0.1
com.google.firebase:firebase-core:10.0.1
com.google.firebase:firebase-messaging:10.0.1
My app works perfectly when you run it on API 23 - 25, but on API 21 & 22 it crashes with the following error:
12-12 15:01:18.436 27069-27069/com.platinum.hydro E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.platinum.hydro, PID: 27069
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
at com.google.firebase.FirebaseApp.<clinit>(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5319)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4893)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4833)
at android.app.ActivityThread.access$1500(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.platinum.hydro-2/base.apk"],nativeLibraryDirectories=[/data/app/com.platinum.hydro-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.google.firebase.FirebaseApp.<clinit>(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5319)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4893)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4833)
at android.app.ActivityThread.access$1500(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.ArrayMap
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Just moving the comments into an answer.
The 9.8.0 version of the firebase library is outdated and might not work well with the other support libraries.
Try using the current version. (10.0.1 as of this answer). You'll also need to update the other Play Services dependencies accordingly
Actually , There is one more reason of this issue :
When we using gradle build with :
compile 'com.google.android.gms:play-services:xxxx'
We had to compile the entire package of APIs into our app.In some cases, doing so made it more difficult to keep the number of methods in our app (including framework APIs, library methods, and your own code) under the 65,536 limit.
So the solution: we should build with only packages which we use :
Example :
compile 'com.google.android.gms:play-services-analytics:x.x.x'
compile 'com.google.android.gms:play-services-gcm:x.x.x'
More detail : https://developers.google.com/android/guides/setup
I was having this same issue and solved it by adding these dependencies to the android/app/build.gradle file:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
// I had to add the following to fix this error.
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.firebase:firebase-firestore:21.1.1'
}