App crashes on launch after adding Firebase Authentication dependency - firebase

I'm integrating firebase authentication into my android project with firebase assistant. After integrating firebase auth, it adds a dependency implementation 'com.google.firebase:firebase-auth:21.0.1' . when I use this dependency app crashes on launch.
and this is the log cat error
2021-07-13 14:03:04.319 20371-20371/? E/.store.admi: Unknown bits set in runtime_flags: 0x8000
2021-07-13 14:03:04.719 20371-20371/app.store.admin W/.ugpapers.admi: Accessing hidden method Ljava/lang/invoke/LambdaMetafactory;->metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; (blacklist, linking, denied)
2021-07-13 14:03:04.719 20371-20371/app.store.admin D/AndroidRuntime: Shutting down VM
2021-07-13 14:03:04.720 20371-20371/app.store.admin E/AndroidRuntime: FATAL EXCEPTION: main
Process: app.ugpapers.admin, PID: 20371
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.runtime/javalib/core-oj.jar)
at com.google.firebase.components.ComponentDiscovery.discoverLazy(ComponentDiscovery.java:112)
at com.google.firebase.FirebaseApp.<init>(FirebaseApp.java:418)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:299)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:267)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:252)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2102)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2076)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45)
at android.app.ActivityThread.installProvider(ActivityThread.java:7430)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6934)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6851)
at android.app.ActivityThread.access$1600(ActivityThread.java:242)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:227)
at android.app.ActivityThread.main(ActivityThread.java:7822)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
2021-07-13 14:03:04.739 20371-20371/app.store.admin I/Process: Sending signal. PID: 20371 SIG: 9
after referring to my old projects I used the old dependency implementation 'com.google.firebase:firebase-auth:20.0.4' and now it's working fine.
Why is the latest dependency not working for me? I'm testing my app on android 10 device.
Also if I add the latest firestore dependency, the app crash on launch.
what's going wrong here?

Related

unity Firebase reports are not printed

After upgrading unity version from 2019 to 2020
Crash intermittently when switching scenes.
So I tried to view the backtrace through firebase crashlytics, but I can't see the backtrace with the error below.
2022-03-11 16:58:10.102 21274-21274/? E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.myapp/lib/arm/libcrashlytics-handler.so" has unexpected e_machine: 40
at com.google.firebase.crashlytics.ndk.CrashpadMain.main(CrashpadMain.java:31)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.myapp/lib/arm/libcrashlytics-handler.so" has unexpected e_machine: 40
at java.lang.Runtime.load0(Runtime.java:908)
at java.lang.System.load(System.java:1537)
at com.google.firebase.crashlytics.ndk.CrashpadMain.main(CrashpadMain.java:29)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) 
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301) 
2022-03-11 16:58:10.107 21274-21274/? E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Bad file descriptor
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)
at android.os.ServiceManager.getService(ServiceManager.java:55)
at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:3049)
at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:3048)
at android.util.Singleton.get(Singleton.java:34)
at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:86)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:123)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
First of all, I checked that "libcrashlytics-handler.so" is in that location and it is there.
And I tried to upgrade the version of the sdk to the latest version of 8.8.0, but it was not resolved.
Does anyone know about this issue? I need your help.
unity version : 2020.3.29f
firebase sdk : 8.8.0
android : 7.1.2(Emulator)

How can i fix This error in background notification handler?

I have a problem with app flutter when I integrate firebase_messaging to receive notification in the background
when I debug I get this error :
I/FLTFireBGExecutor(29060): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling] W/FlutterEngineCxnRegstry(29060): Attempted to register plugin (io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry$ShimRegistrarAggregate#2549a44) but it was already registered with this FlutterEngine (io.flutter.embedding.engine.FlutterEngine#99e972d). E/MethodChannel#(29060): Parameter messenger must not be null. I/BlockMonitor(29060): dispatchingThrewException In MainThread D/AndroidRuntime(29060): Shutting down VM I/QarthLog(29060): [PatchStore] createDisableExceptionQarthFile I/QarthLog(29060): [PatchStore] create disable file for com.dgmsolutions.foolivery uid is 10523 E/AndroidRuntime(29060): FATAL EXCEPTION: main E/AndroidRuntime(29060): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.BinaryMessenger.setMessageHandler(java.lang.String, io.flutter.plugin.common.BinaryMessenger$BinaryMessageHandler)' on a null object reference E/AndroidRuntime(29060): at io.flutter.plugin.common.MethodChannel.setMethodCallHandler(MethodChannel.java:119) E/AndroidRuntime(29060): at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingPlugin.initInstance(FlutterFirebaseMessagingPlugin.java:64) E/AndroidRuntime(29060): at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingPlugin.registerWith(FlutterFirebaseMessagingPlugin.java:58) E/AndroidRuntime(29060): at com.dgmsolutions.foolivery.Application.registerWith(Application.kt:16) E/AndroidRuntime(29060): at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$null$0$FlutterFirebaseMessagingBackgroundExecutor(FlutterFirebaseMessagingBackgroundExecutor.java:206) E/AndroidRuntime(29060): at io.flutter.plugins.firebase.messaging.-$$Lambda$FlutterFirebaseMessagingBackgroundExecutor$e4cdQ2b1x-adsVcO-hA2dn2VM8E.run(Unknown Source:6) E/AndroidRuntime(29060): at android.os.Handler.handleCallback(Handler.java:888) E/AndroidRuntime(29060): at android.os.Handler.dispatchMessage(Handler.java:100) E/AndroidRuntime(29060): at android.os.Looper.loop(Looper.java:213) E/AndroidRuntime(29060): at android.app.ActivityThread.main(ActivityThread.java:8178) E/AndroidRuntime(29060): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(29060): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) E/AndroidRuntime(29060): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) I/Process (29060): Sending signal. PID: 29060 SIG: 9 Lost connection to device.
my code (in the picture)
main class
application.kt
manifest.xml
notification class
Since you're running Flutter 2.0.1, you only need to configure the Flutter part of the firebase messaging plugin, and add your google-services.json files.
Read carefully the official documentation and you'll fix your problem :)
If you need a sample project showcasing how to implement the Firebase Notifications, you can take a look at this one

Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext

I want to build an app with Ionic V3 for Android but I have an issue when I build it on release.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.security.Provider$Service.getImplClass(Provider.java:1728)
at java.security.Provider$Service.newInstance(Provider.java:1686)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
at com.crashlytics.reloc.org.apache.http.ssl.SSLContexts.createDefault(SSLContexts.java:51)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:56)
at com.crashlytics.api.net.proxy.ProxySettings.getClientFor(ProxySettings.java:56)
at com.crashlytics.api.RestfulWebApi.notifyBuildEvent(RestfulWebApi.java:1438)
at com.crashlytics.api.RestfulWebApi.access$100(RestfulWebApi.java:74)
at com.crashlytics.api.RestfulWebApi$10.run(RestfulWebApi.java:1371)
at java.lang.Thread.run(Thread.java:748)
It seems to be caused by Crashlytics (which I don't even use) which is integrated within this package https://github.com/dpa99c/cordova-plugin-firebasex.
When I build the app in debug mode, I still have the exception but the build proceed until the end and I still can run it on my phone.
How can I prevent this issue ? Is there anyway to disable entirely Crashlytics so I don't have this exception anymore ?
Thanks
Ok, so it was all because of the JDK version. I ended up updating the JDK and everything worked perfectly.

map fragment shows blank when app resumes from background to front. GL thread crash

I compiled a HERE tutorial app, "basic map solution", and installed it on Motorola XT1565(android 6.0.1). When I launch it, the map view can be shown, but if I move it to background and later bring it back to front, sometimes I see the map view is blank: no map content. I caught the following GL thread crash error in the log.
I am using HERE Android SDK 3.1.1, and I can not find same issue on Here official app from Google Playstore. So I wonder if this issue is related to EGL lib compatible issue or there are some bugs in Here SDK native lib?
07-05 13:56:02.034 18468-18952/com.here.android.tutorial I/Adreno: QUALCOMM build : 166ada0, Ifd751822f5
Build Date : 01/26/16
OpenGL ES Shader Compiler Version: XE031.06.00.05
Local Branch : AU12_SBA
Remote Branch :
Remote Branch :
Reconstruct Branch :
07-05 13:56:02.185 18468-18952/com.here.android.tutorial I/OpenGLRenderer: Initialized EGL, version 1.4
07-05 13:56:02.288 18468-2216/com.here.android.tutorial E/BaseTextureView: ******** GL Thread crash ********Thread[BaseTextureView-RenderThread,6,main]
07-05 13:56:02.391 18468-2216/com.here.android.tutorial W/System.err: java.lang.RuntimeException: createWindowSurface failed EGL_BAD_CONFIG
07-05 13:56:02.392 18468-2216/com.here.android.tutorial W/System.err: at com.nokia.maps.y$a.f(BaseTextureView.java:495)
07-05 13:56:02.392 18468-2216/com.here.android.tutorial W/System.err: at com.nokia.maps.y$a.run(BaseTextureView.java:301)
07-05 13:56:02.392 18468-2216/com.here.android.tutorial E/BaseTextureView: ******** GL Thread crash ********Thread[BaseTextureView-RenderThread,6,main]
07-05 13:56:02.445 18468-2216/com.here.android.tutorial E/libEGL: eglDestroySurface:595 error 300d (EGL_BAD_SURFACE)
07-05 13:56:02.445 18468-2216/com.here.android.tutorial E/libEGL: eglDestroyContext:697 error 3006 (EGL_BAD_CONTEXT)
Please check with SDK 4.x that was released last week, since this problem should be fixed with this version.

Firebase database getInstance crashes app

When running the sample after creating google-service.json, the app crashes when trying to get database reference in SignInActivity
mDatabase = FirebaseDatabase.getInstance().getReference();
Crash log
05-21 09:27:27.644 488-488/com.google.firebase.quickstart.database D/AndroidRuntime: Shutting down VM
05-21 09:27:27.644 488-488/com.google.firebase.quickstart.database E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.firebase.quickstart.database, PID: 488
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.firebase.quickstart.database/com.google.firebase.quickstart.database.SignInActivity}: com.google.firebase.database.DatabaseException: Failed to get
FirebaseDatabase instance: FirebaseApp object has no DatabaseURL in its FirebaseOptions object.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: FirebaseApp object has no DatabaseURL in its FirebaseOptions object.
at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
at com.google.firebase.quickstart.database.SignInActivity.onCreate(SignInActivity.java:39)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
How to fix this issue ?
Download google-services.json from Project Settings in the Firebase console. My mistake was downloading it from https://developers.google.com/mobile/add.
Changing google-services.json file didn't worked for me
later i found out
that i was using
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
instead of
implementation 'com.google.firebase:firebase-analytics-ktx:17.5.0'
implementation 'com.google.firebase:firebase-database-ktx:19.4.0'
mFirebaseDatabaseReference = database.getInstance().getReference("root-element in firebase");
When you call getReference you need to provide a URL. If your project is bound already in Firebase with the database you have created, use the root element of the data in Firebase as the parameter to getReference().

Resources