invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.66k stars 2.21k forks source link

0.73.1 Android flash error message:Default FirebaseApp is not initialized #7691

Closed shihao905 closed 5 months ago

shihao905 commented 6 months ago

Issue

When I was developing on the android side, I had a flashback problem, but I didn't have this problem on the ios side. Is it related to my introduction of third-party packages? The question is as follows:

03-19 11:41:10.686 E/OpenGLRenderer(  751): Unable to match the desired swap behavior.
03-19 11:41:11.380 E/ingtian.pro.app(13341): Attempt to load writable dex file: /data/user/0/io.ht.qingtian.pro.app/files/libs/tdata_IWV990.jar
03-19 11:41:11.418 E/ingtian.pro.app(13341): Attempt to load writable dex file: /data/user/0/io.ht.qingtian.pro.app/files/libs/tdata_MNg402.jar
03-19 11:41:11.551 E/OpenGLRenderer(13341): Unable to match the desired swap behavior.
03-19 11:41:11.605 E/ingtian.pro.app(13341): Invalid resource ID 0x00000000.
03-19 11:41:11.617 E/OpenGLRenderer(13341): Unable to match the desired swap behavior.
03-19 11:41:11.629 E/AndroidRuntime(13341): FATAL EXCEPTION: AsyncTask #1
03-19 11:41:11.629 E/AndroidRuntime(13341): Process: io.ht.qingtian.pro.app, PID: 13341
03-19 11:41:11.629 E/AndroidRuntime(13341): java.lang.RuntimeException: An error occurred while executing doInBackground()
03-19 11:41:11.629 E/AndroidRuntime(13341):     at android.os.AsyncTask$4.done(AsyncTask.java:415)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.FutureTask.run(FutureTask.java:269)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.lang.Thread.run(Thread.java:1012)
03-19 11:41:11.629 E/AndroidRuntime(13341): Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process io.ht.qingtian.pro.app. Make sure to call FirebaseApp.initializeApp(Context) first.
03-19 11:41:11.629 E/AndroidRuntime(13341):     at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:183)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at com.google.firebase.messaging.FirebaseMessaging.getInstance(com.google.firebase:firebase-messaging@@21.1.0:1)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at com.wix.reactnativenotifications.fcm.FcmToken.refreshToken(FcmToken.java:75)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at com.wix.reactnativenotifications.fcm.FcmToken.onAppReady(FcmToken.java:65)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at com.wix.reactnativenotifications.fcm.FcmInstanceIdRefreshHandlerService.onHandleWork(FcmInstanceIdRefreshHandlerService.java:26)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:396)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:387)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at android.os.AsyncTask$3.call(AsyncTask.java:394)
03-19 11:41:11.629 E/AndroidRuntime(13341):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
03-19 11:41:11.629 E/AndroidRuntime(13341):     ... 3 more
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007): Failed to fetch suggestions from AppSearch, fallback to AGA
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007): java.util.concurrent.CompletionException: java.util.NoSuchElementException: No value present
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:308)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:323)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:684)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:486)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2138)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at com.google.android.apps.nexuslauncher.allapps.H0.onResult(Unknown Source:59)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.app.appsearch.SearchSessionUtil$1.lambda$onResult$0(SearchSessionUtil.java:129)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.app.appsearch.SearchSessionUtil$1.$r8$lambda$_nlk9WiPjSfaAsqKYmp0aPvSRC0(SearchSessionUtil.java:1)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.app.appsearch.SearchSessionUtil$1$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:13)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.os.Handler.handleCallback(Handler.java:958)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.os.Handler.dispatchMessage(Handler.java:99)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.os.Looper.loopOnce(Looper.java:205)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.os.Looper.loop(Looper.java:294)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at android.os.HandlerThread.run(HandlerThread.java:67)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007): Caused by: java.util.NoSuchElementException: No value present
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at java.util.Optional.get(Optional.java:144)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   at com.google.android.apps.nexuslauncher.allapps.H0.onResult(Unknown Source:16)
03-19 11:41:11.710 E/OneSearchSuggestProvider( 1007):   ... 8 more
03-19 11:41:11.721 E/OpenGLRenderer( 1650): Unable to match the desired swap behavior.
03-19 11:41:11.728 E/OpenGLRenderer( 1007): Unable to match the desired swap behavior.
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007): Unable to get suggestions from AGA
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007): io.grpc.StatusRuntimeException: UNKNOWN
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at S2.d.a(Unknown Source:68)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at io.grpc.internal.p.b(Unknown Source:32)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at io.grpc.internal.p.a(Unknown Source:14)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at io.grpc.internal.C.run(Unknown Source:6)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at io.grpc.internal.y2.run(Unknown Source:18)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
03-19 11:41:11.933 E/OneSearchSuggestProvider( 1007):   at java.lang.Thread.run(Thread.java:1012)
03-19 11:41:12.122 E/BpTransactionCompletedListener(  393): Failed to transact (-32)

Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "qingtianPro", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "build:android": "cd android && rm -rf app/build/outputs && ./gradlew assembleRelease", "bundle-ios": "react-native bundle --entry-file index.js --bundle-output ./ios/bundle/index.ios.jsbundle --platform ios --assets-dest ./ios/bundle --dev false" }, "dependencies": { "@ant-design/icons": "^5.3.1", "@ant-design/icons-react-native": "^2.3.2", "@ant-design/react-native": "^5.1.1", "@react-native-async-storage/async-storage": "^1.21.0", "@react-native-camera-roll/camera-roll": "^7.3.0", "@react-native-clipboard/clipboard": "^1.13.2", "@react-native-community/masked-view": "^0.1.11", "@react-native-community/netinfo": "^9.3.9", "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-community/segmented-control": "^2.2.2", "@react-native-community/slider": "^4.3.3", "@react-native-community/viewpager": "^5.0.11", "@react-native-picker/picker": "^2.6.1", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", "@react-navigation/stack": "^6.3.20", "@rneui/base": "^4.0.0-rc.8", "@rneui/themed": "^4.0.0-rc.8", "@sentry/react-native": "^5.15.2", "axios": "^1.6.3", "babel-plugin-module-resolver": "^5.0.0", "big.js": "^6.2.1", "dayjs": "^1.11.10", "deprecated-react-native-prop-types": "^5.0.0", "metro-react-native-babel-preset": "^0.77.0", "qs": "^6.12.0", "react": "18.2.0", "react-hook-form": "^7.50.1", "react-native": "0.73.1", "react-native-ali-onepass": "^3.3.2", "react-native-amap-geolocation": "^1.2.3", "react-native-asset": "^2.1.1", "react-native-camera": "^4.2.1", "react-native-device-info": "^10.13.1", "react-native-document-picker": "^9.1.0", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.14.0", "react-native-getui": "1.1.43", "react-native-image-marker": "^1.2.2", "react-native-image-picker": "^7.1.0", "react-native-linear-gradient": "^2.8.3", "react-native-notifications": "^5.1.0", "react-native-permissions": "^3.8.0", "react-native-portalize": "^1.0.7", "react-native-progress": "^5.0.1", "react-native-qrcode-scanner": "1.4.1", "react-native-reanimated": "^3.6.1", "react-native-safe-area-context": "^4.9.0", "react-native-screens": "^3.29.0", "react-native-size-matters": "^0.4.2", "react-native-static-safe-area-insets": "^2.2.0", "react-native-svg": "^14.1.0", "react-native-swiper": "^1.6.0", "react-native-vector-icons": "^10.0.3", "react-native-webview": "^13.6.3" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "^0.73.18", "@react-native/eslint-config": "^0.73.1", "@react-native/metro-config": "^0.73.2", "@react-native/typescript-config": "^0.73.1", "@types/qs": "^6.9.12", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "babel-plugin-import": "^1.13.8", "babel-plugin-root-import": "^6.6.0", "eslint": "^8.19.0", "eslint-import-resolver-babel-plugin-root-import": "^1.1.1", "jest": "^29.6.3", "jetifier": "^2.0.0", "prettier": "2.8.8", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" }, "resolutions": { "react-native-permissions": "^3.8.0" }, "overrides": { "react-native-qrcode-scanner": { "react-native-permissions": "^3.8.0" } } } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [x] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`


shihao905 commented 6 months ago

I just checked my 3rd party package and found that this is probably a react-native notifications issue: https://github.com/wix/react-native-notifications/issues/947

When I delete the android terminal is normal

github-actions[bot] commented 5 months ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.