FirebaseApp with name APP_ID doesn't exist. Available app names: [DEFAULT] - android

I have a react native app that has firebase modules such as
"#react-native-firebase/app": "^14",
"#react-native-firebase/messaging": "^14",
App is working fine with debugging mode, Apk is also fine, but when I publish it to google play internal testing, App is crashing after installing it with below error! There is no issue with app ids and json file. I have already double checked it.
FATAL EXCEPTION: mqt_native_modules
Process: com.app, PID: 26684
java.lang.IllegalStateException: FirebaseApp with name XXXXXXXXXXXXX doesn't exist. Available app names: [DEFAULT]
at com.google.firebase.FirebaseApp.getInstance(Unknown Source:83)
at io.invertase.firebase.messaging.ReactNativeFirebaseMessagingModule.getToken(Unknown Source:0)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)
at java.lang.Thread.run(Thread.java:1012)
2023-01-15 01:35:51.642 1629-2656 ActivityManager
pid-1629

Related

Android Singed APK crashed

I am facing issue with the Signed APK, debug apk works perfectly, When I generate signed apk and run it show error.
below is error log
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.woodenstreet, PID: 25818
java.lang.NoSuchMethodError: No virtual method x(Ljava/lang/String;I)I in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /apex/com.android.runtime/javalib/core-libart.jar)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.d(SourceFile:1)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.e(SourceFile:2)
at com.google.firebase.crashlytics.internal.settings.SettingsController.(SourceFile:11)
at com.google.firebase.crashlytics.internal.settings.SettingsController.l(SourceFile:14)
at com.google.firebase.crashlytics.internal.Onboarding.l(SourceFile:4)
at com.google.firebase.crashlytics.FirebaseCrashlytics.a(SourceFile:26)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.b(SourceFile:5)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.a(Unknown Source:0)
at com.google.firebase.crashlytics.CrashlyticsRegistrar$$Lambda$1.a(Unknown Source:2)
at com.google.firebase.components.ComponentRuntime.f(SourceFile:1)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(SourceFile:6)
at com.google.firebase.components.ComponentRuntime.e(SourceFile:5)
at com.google.firebase.FirebaseApp.n(SourceFile:7)
at com.google.firebase.FirebaseApp.q(SourceFile:13)
at com.google.firebase.FirebaseApp.p(SourceFile:1)
at com.google.firebase.FirebaseApp.o(SourceFile:7)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:1)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2092)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2066)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
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:930)
Here build.gradle app level file
Build file
I am not able to figure out the error please help me.
Thanks
Your release configuration in build.gradle is not correct for your libraries. I think it have to do with json, and proguard obfuscates some methods of it.
try this https://stackoverflow.com/a/61481954/10117882

Flutter AWS Cognito app in release mode crashes on Android

I have created a Flutter application that uses amplify_auth_cognito and amplify_core packages for authentication.
In debug mode, the app works fine without any issues. The iOS version works fine as well, even when installed from the TestFlight.
However, when I run in release mode created apk on a physical Android device, whenever I click on a button that calls Amplify.Auth.signIn(username, password) function, the whole app crashes.
App crash log says:
time: 1604934616377
msg: java.lang.NoSuchFieldException: SUCCESS
stacktrace: java.lang.AssertionError: java.lang.NoSuchFieldException: SUCCESS
at c.b.b.w.n.n$j0.<init>(Unknown Source:87)
at c.b.b.w.n.n$w.a(Unknown Source:29)
at c.b.b.e.a(Unknown Source:74)
at c.b.b.w.n.i.a(Unknown Source:42)
at c.b.b.w.n.i.a(Unknown Source:123)
at c.b.b.w.n.i.a(Unknown Source:22)
at c.b.b.e.a(Unknown Source:74)
at c.b.b.e.a(Unknown Source:4)
at c.b.b.e.a(Unknown Source:8)
at c.b.b.e.a(Unknown Source:5)
at c.b.b.e.a(Unknown Source:13)
at com.amazonaws.amplify.amplify_auth_cognito.types.FlutterFetchCognitoAuthSessionResult.a(Unknown Source:4)
at com.amazonaws.amplify.amplify_auth_cognito.types.FlutterFetchCognitoAuthSessionResult.a(Unknown Source:42)
at com.amazonaws.amplify.amplify_auth_cognito.AuthCognito$prepareCognitoSessionResult$1.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7398)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: java.lang.NoSuchFieldException: SUCCESS
at java.lang.Class.getField(Class.java:1604)
at c.b.b.w.n.n$j0.<init>(Unknown Source:34)
... 20 more
Any idea why is this happening and how to fix it?

Huawei DRM SDK gives RuntimeException

I have and app published on Huawei AppGallery. The application is paid and is protected by the huawei DRM SDK, and everything was working fine even the huawei DRM SDK.
But I now wanted to launch a new version of the application, but I get this error:
2020-06-19 15:11:16.797 17128-17128/com.aquainfo.huawei E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.aquainfo.huawei, PID: 17128
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aquainfo.huawei/com.huawei.android.sdk.drm.DrmDialogActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:430)
at android.content.res.HwResources.getText(HwResources.java:463)
at android.content.res.Resources.getString(Resources.java:523)
at android.content.Context.getString(Context.java:582)
at com.huawei.android.sdk.drm.j.a(Unknown Source:124)
at com.huawei.android.sdk.drm.DrmDialogActivity.onCreate(Unknown Source:143)
at android.app.Activity.performCreate(Activity.java:7458)
at android.app.Activity.performCreate(Activity.java:7448)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) 
at android.os.Handler.dispatchMessage(Handler.java:112) 
at android.os.Looper.loop(Looper.java:216) 
at android.app.ActivityThread.main(ActivityThread.java:7625) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) 
Based on this line com.huawei.android.sdk.drm.DrmDialogActivity} I think that the problem is with the huawei SDK, but so far it was working well with the DRM SDK.
My DRM sdk version is the 2.5.2.300. Is there somthing happening with that SDK? Ore hase the version chaged?
Thanks
The problem is caused by your resource files not found.
Verify that the resource files in .res file in DRM SDK folder are correctly imported, and not mistakenly deleted. Import them again if necessary.
For details, visit the official document DRM Service.

Ionic Capacitor firebase push notification, error:Default FirebaseApp is not initialized in this process

I am new to Capacitor and have migrating my Cordova project to Capacitor.
I trying to get my notification messages working. Therefore i followed the steps shown in
https://capacitor.ionicframework.com/docs/guides/push-notifications-firebase/
Once i build my project, i am opening the project and Android Studio starts. I preform a run, and the app the starts to get downloaded on to my phone, which i then run.
And i get this error message shown below when it comes registering my phone for notification messages.
Am i missing a step?
The google-services.json is also placed in Andriod-->App
Thanks
E/Capacitor: Serious error executing plugin
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)
at com.getcapacitor.Bridge$1.run(Bridge.java:515)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.aardra.cloud. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common##19.3.0:184)
at com.google.firebase.messaging.FirebaseMessaging.getInstance(com.google.firebase:firebase-messaging##20.1.2:1)
at com.getcapacitor.plugin.PushNotifications.register(PushNotifications.java:82)
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:515) 
at android.os.Handler.handleCallback(Handler.java:873) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:201) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
E/AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins
Process: com.aardra.cloud, PID: 749
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.getcapacitor.Bridge$1.run(Bridge.java:524)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)
at com.getcapacitor.Bridge$1.run(Bridge.java:515)
at android.os.Handler.handleCallback(Handler.java:873) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:201) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.aardra.cloud. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common##19.3.0:184)
at com.google.firebase.messaging.FirebaseMessaging.getInstance(com.google.firebase:firebase-messaging##20.1.2:1)
at com.getcapacitor.plugin.PushNotifications.register(PushNotifications.java:82)
at java.lang.reflect.Method.invoke(Native Method) 
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) 
at com.getcapacitor.Bridge$1.run(Bridge.java:515) 
at android.os.Handler.handleCallback(Handler.java:873) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:201) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
I had the same problem. In my case I forgot to put google-services.json in android/app folder.
Verify:
google-services.json be in android/app folder and your Android package name should match the appId from your capacitor.config.json file.
We used com.mydomain.myappname for this Capacitor app ID, so that is what we’ll use for this entry.
capacitor.config.json has PushNotifications setup:
{
...
"plugins": {
"SplashScreen": {
...
},
"PushNotifications": {
"presentationOptions": ["badge", "sound", "alert"]
}
},
...
}
Then build your js project and sync.
npx cap sync android
npx cap open android
And build your Android app or test in an emulator.

getting crash in react native app for android

in our react native app we have used firebase, and location services .
here we are getting crash in react native and its very difficult to understand and reproduce it.
here is the crash.
Fatal Exception: java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:152)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1285)
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:458)
at io.invertase.firebase.firestore.RNFirebaseFirestoreTransactionHandler.safeUnlock(RNFirebaseFirestoreTransactionHandler.java:160)
at io.invertase.firebase.firestore.RNFirebaseFirestoreTransactionHandler.abort(RNFirebaseFirestoreTransactionHandler.java:50)
at io.invertase.firebase.firestore.RNFirebaseFirestore.transactionDispose(RNFirebaseFirestore.java:281)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
how to check the cause of this crash in react native ?

Categories

Resources