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.73k stars 2.22k forks source link

[πŸ›] [Android] Firebase Messaging Crashing Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE #6147

Closed minhchienwikipedia closed 2 years ago

minhchienwikipedia commented 2 years ago

Issue

Hi, I got the issue on android 12

Fatal Exception: java.lang.IllegalArgumentException
com.example: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

Project Files

Javascript

Click To Expand

#### `package.json`: ```json "dependencies": { "@invertase/react-native-apple-authentication": "^2.1.0", "@react-native-async-storage/async-storage": "^1.14.1", "@react-native-community/cameraroll": "^4.0.2", "@react-native-community/clipboard": "^1.5.1", "@react-native-community/datetimepicker": "^3.5.2", "@react-native-community/hooks": "^2.6.0", "@react-native-community/image-editor": "^2.3.0", "@react-native-community/masked-view": "^0.1.9", "@react-native-community/netinfo": "^6.0.6", "@react-native-community/push-notification-ios": "^1.8.0", "@react-native-community/slider": "^4.1.12", "@react-native-community/toolbar-android": "^0.2.1", "@react-native-firebase/admob": "^11.5.0", "@react-native-firebase/analytics": "^11.5.0", "@react-native-firebase/app": "^11.5.0", "@react-native-firebase/auth": "^11.5.0", "@react-native-firebase/crashlytics": "^11.5.0", "@react-native-firebase/database": "^11.5.0", "@react-native-firebase/dynamic-links": "^11.5.0", "@react-native-firebase/firestore": "^11.5.0", "@react-native-firebase/functions": "^11.5.0", "@react-native-firebase/iid": "^11.5.0", "@react-native-firebase/messaging": "^11.5.0", "@react-native-firebase/remote-config": "^11.5.0", "@react-native-firebase/storage": "^11.5.0", "@react-native-google-signin/google-signin": "^7.0.0-alpha.3", "@react-navigation/bottom-tabs": "^5.11.8", "@react-navigation/native": "^5.1.6", "@react-navigation/stack": "^5.2.11", "axios": "^0.21.0", "cache": "^2.3.1", "clean": "^4.0.2", "color": "^3.1.3", "dayjs": "^1.11.0", "fbjs": "^0.8.18", "formik": "^2.2.9", "geofire-common": "^5.2.0", "hermes-engine": "^0.9.0", "i18n-js": "^3.5.1", "libphonenumber-js": "^1.9.44", "lodash": "^4.17.20", "lottie-ios": "^3.2.3", "lottie-react-native": "^4.1.3", "moment": "^2.24.0", "moti": "^0.6.5", "npm": "^7.6.1", "patch-package": "^6.4.7", "react": "17.0.2", "react-firebase-hooks": "^2.2.0", "react-firebase-pagination-hooks": "^1.0.0", "react-native": "^0.66.3", "react-native-canvas": "^0.1.37", "react-native-circular-progress-indicator": "^2.0.6", "react-native-code-push": "^7.0.4", "react-native-component-kits": "^1.0.30", "react-native-detector": "^0.2.1", "react-native-device-info": "^8.4.5", "react-native-document-picker": "^8.0.0", "react-native-fast-image": "^8.5.11", "react-native-fbsdk-next": "^4.4.1", "react-native-fs": "^2.18.0", "react-native-geolocation-service": "^5.3.0-beta.1", "react-native-gesture-handler": "^1.6.1", "react-native-gifted-chat": "^0.16.3", "react-native-iap": "^6.0.0-rc.23", "react-native-image-picker": "^4.1.2", "react-native-in-app-review": "^3.1.0", "react-native-interactable": "^2.0.1", "react-native-keyboard-aware-scroll-view": "^0.8.0", "react-native-linear-gradient": "^2.5.6", "react-native-localize": "^1.3.2", "react-native-modalize": "^2.0.13", "react-native-permissions": "^3.0.1", "react-native-pose": "^0.9.1", "react-native-reanimated": "^2.5.0", "react-native-restart": "0.0.20", "react-native-safe-area-context": "^0.7.3", "react-native-screens": "^2.5.0", "react-native-scrollable-tab-view": "^1.0.0", "react-native-sound": "^0.11.1", "react-native-sound-manager": "^1.0.9", "react-native-splash-screen": "^3.2.0", "react-native-svg": "^12.3.0", "react-native-swipe-up-down": "^1.1.6", "react-native-touch-id": "^4.4.1", "react-native-track-player": "^2.1.2", "react-native-vector-icons": "^6.6.0", "react-native-view-shot": "^3.1.2", "react-native-webview": "^9.3.0", "react-redux": "^7.1.0", "recyclerlistview": "^3.0.5", "redux": "^4.0.4", "redux-persist": "^5.10.0", "rxjs": "^7.0.1", "yup": "^0.32.9" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "babel-plugin-module-resolver": "^4.0.0", "eslint": "7.14.0", "eslint-config-standard": "^14.1.0", "eslint-config-standard-react": "^9.2.0", "eslint-import-resolver-babel-module": "^5.1.2", "eslint-plugin-flowtype": "^4.5.2", "eslint-plugin-import": "^2.22.0", "husky": "^7.0.4", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } ``` #### `firebase.json` for react-native-firebase v6: ```json {} ```


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 ext { compileSdkVersion = rootProject.ext.compileSdkVersion }// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 firebaseMessagingVersion = "21.1.0" firebaseCoreVersion = "17.0.0" firebaseVersion = "21.1.0" googlePlayServicesVersion = "17.0.0" ndkVersion = "21.4.7075529" } repositories { google() mavenCentral() } dependencies { classpath('com.android.tools.build:gradle:7.0.3') classpath 'com.google.gms:google-services:4.3.5' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } jcenter() { content { includeGroup("com.google.android.exoplayer") } } google() maven { url 'https://www.jitpack.io' } } } ``` #### `android/app/build.gradle`: ```groovy def useIntlJsc = false def work_version = "2.7.0" apply plugin: "com.android.application" apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' import com.android.build.OutputFile /** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle * bundleAssetName: "index.android.bundle", * * // the entry file for bundle generation. If none specified and * // "index.android.js" exists, it will be used. Otherwise "index.js" is * // default. Can be overridden with ENTRY_FILE environment variable. * entryFile: "index.android.js", * * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode * bundleInDebug: false, * * // whether to bundle JS and assets in release mode * bundleInRelease: true, * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants * // The configuration property can be in the following formats * // 'bundleIn${productFlavor}${buildType}' * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, * * // whether to disable dev mode in custom build variants (by default only disabled in release) * // for example: to disable dev mode in the staging build type (if configured) * devDisabledInStaging: true, * // The configuration property can be in the following formats * // 'devDisabledIn${productFlavor}${buildType}' * // 'devDisabledIn${buildType}' * * // the root of your project, i.e. where "package.json" lives * root: "../../", * * // where to put the JS bundle asset in debug mode * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * * // where to put the JS bundle asset in release mode * jsBundleDirRelease: "$buildDir/intermediates/assets/release", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in release mode * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * * // by default the gradle tasks are skipped if none of the JS files or assets change; this means * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ project.ext.react = [ enableHermes: true, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false /** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false); /** * Architectures to build native code for in debug. */ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion flavorDimensions "default" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "${AppApplicationId}" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode Integer.parseInt(AppVersionCode) versionName "${AppVersionName}" multiDexEnabled true missingDimensionStrategy 'store', 'play' } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file(MYAPP_TEST_STORE_FILE) storePassword MYAPP_TEST_STORE_PASSWORD keyAlias MYAPP_TEST_KEY_ALIAS keyPassword MYAPP_TEST_KEY_PASSWORD } release { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } buildTypes { String taskRequest = getGradle().getStartParameter().getTaskRequests().toString() String flavor = 'publish' if (taskRequest.contains('Dev')) flavor = 'dev' debug { signingConfig signingConfigs.debug if (nativeArchitectures) { ndk { abiFilters nativeArchitectures.split(',') } } } release { if (flavor == 'dev') { signingConfig signingConfigs.debug }else { signingConfig signingConfigs.release } minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } productFlavors { dev { versionName "${AppVersionName}" applicationId "${AppApplicationId}.dev" manifestPlaceholders = [ appIcon: "@mipmap/ic_dev", appIconRound: "@mipmap/ic_dev_round", fbId: "@string/facebook_app_id_dev", fbScheme: "@string/fb_login_protocol_scheme_dev" ] } publish { versionName "${AppVersionName}" applicationId "${AppApplicationId}" manifestPlaceholders = [ appIcon: "@mipmap/ic_launcher", appIconRound: "@mipmap/ic_launcher_round", fbId: "@string/facebook_app_id", fbScheme: "@string/fb_login_protocol_scheme" ] } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = defaultConfig.versionCode } } } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation project(path: ":react-native-interactable") implementation 'com.android.support:multidex:1.0.3' implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.facebook.android:facebook-android-sdk:[5,6)' implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" implementation "androidx.work:work-runtime:$work_version" implementation "androidx.work:work-runtime-ktx:$work_version" implementation project(':react-native-splash-screen') debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' } if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } } // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'BeenAlone' include ':react-native-splash-screen' project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' include ':react-native-interactable' project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android') include ':app', ':react-native-code-push' project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') ``` #### `MainApplication.java`: ```java package com.example; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.microsoft.codepush.react.CodePush; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; import com.facebook.FacebookSdk; import com.facebook.appevents.AppEventsLogger; import com.wix.interactable.Interactable; import com.facebook.react.bridge.JSIModulePackage; import com.swmansion.reanimated.ReanimatedJSIModulePackage; import com.example.nativeModules.RNPackages; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: packages.add(new RNPackages()); packages.add(new Interactable()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } @Override protected String getJSBundleFile() { return CodePush.getJSBundleFile(); } @Override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); FacebookSdk.sdkInitialize(getApplicationContext()); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class aClass = Class.forName("com.example.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } } ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 12.2 CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz Memory: 27.19 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.20.2 - ~/.nvm/versions/node/v12.20.2/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.14.11 - ~/.nvm/versions/node/v12.20.2/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/lib/ruby/gems/3.0.0/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 11.0.13 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: ^0.66.3 => 0.66.3 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found ``` - **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:** - `"@react-native-firebase/messaging": "^11.5.0"` - **`Firebase` module(s) you're using that has the issue:** - `Messaging` - **Are you using `TypeScript`?** - `N`


mikehardy commented 2 years ago

If you update to modern versions this will not happen, these are quite old:


    "@react-native-firebase/admob": "^11.5.0",
    "@react-native-firebase/analytics": "^11.5.0",
    "@react-native-firebase/app": "^11.5.0",
    "@react-native-firebase/auth": "^11.5.0",
    "@react-native-firebase/crashlytics": "^11.5.0",
    "@react-native-firebase/database": "^11.5.0",
    "@react-native-firebase/dynamic-links": "^11.5.0",
    "@react-native-firebase/firestore": "^11.5.0",
    "@react-native-firebase/functions": "^11.5.0",
    "@react-native-firebase/iid": "^11.5.0",
    "@react-native-firebase/messaging": "^11.5.0",
    "@react-native-firebase/remote-config": "^11.5.0",
    "@react-native-firebase/storage": "^11.5.0",

I see that you are using admob, and this is probably why you are still on v11.5. Sorry that took so long to convert, but we have a living breathing admob package again - separate from react-native-firebase - over here at https://github.com/invertase/react-native-google-mobile-ads - you should port over to that, then you can remove @react-native-firebase/admob, then you can update versions here (the changes are hopefully pretty small, our philosophy is here https://invertase.io/blog/react-native-firebase-versioning and the CHANGELOG will have specific details for each major version).

The admob port may be a bit of work but that was unavoidable unfortunately, AdMob libraries themselves went through some major changes, and especially v4 to v5 of that package brings in the new consent framework Google has moved to, but there is a migration guide in the mobile ads package.

It won't be a trivial amount of work but hopefully is not too bad. Google APIs move pretty quickly unfortunately

minhchienwikipedia commented 2 years ago

@mikehardy Yeah, I know it, but I just want to find a way to quickly resolve it by myself for now?

mikehardy commented 2 years ago

Looks to me like firebase-android-sdk did not handle Android 12 until the 28.0.0 bill-of-materials release ref https://firebase.google.com/support/release-notes/android#messaging_v22-0-0

We supported that here first in v12 here https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#1200-2021-05-19

I believe you have deferred maintenance as long as possible unfortunately.

minhchienwikipedia commented 2 years ago

@mikehardy πŸ₯² I have a lot of work so I just want to fix it quickly, anyway thanks for your support. I'll spend my time upgrading it and moving Admob

ashishHp1 commented 2 years ago

Fatal Exception: java.lang.IllegalArgumentException: com.traineffective: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:382) at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:465) at android.app.PendingIntent.getActivity(PendingIntent.java:451) at android.app.PendingIntent.getActivity(PendingIntent.java:415) at com.google.firebase.messaging.CommonNotificationBuilder.createContentIntent(com.google.firebase:firebase-messaging@@20.3.0:125) at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:27) at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:9) at com.google.firebase.messaging.DisplayNotification.handleNotification(com.google.firebase:firebase-messaging@@20.3.0:27) at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@20.3.0:65) at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@20.3.0:44) at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@20.3.0:27) at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@20.3.0:17) at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@20.3.0:43) at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(:6) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6) at java.lang.Thread.run(Thread.java:920)

  I have added work runtime to 2.7.1 but it is not resolved. HELP NEEDED!!
elowareAdm commented 2 years ago

same problem here, any update??

mikehardy commented 2 years ago

@elowareAdm please carefully read these comments. There is no problem in the repository, it appears your project is on outdated dependencies

https://github.com/invertase/react-native-firebase/issues/6147#issuecomment-1076464432

There is nothing actionable here and there will likely be no more updates (other than people posting, looking for updates...)

justinmwarner commented 2 years ago

Can we get this put on the documentation on https://rnfb-docs.netlify.app/admob/usage ? I didn't know about this other package at the time and didn't even think about the version number being so low because I added it blindly using yarn add. Thanks for all the effort you put into this!

mikehardy commented 2 years ago

@justinmwarner I don't believe we can publish to any of the docs sites anymore? I did just mark the package deprecated on npmjs.com though, that should help give people a big heads up not to use it

ViniciusMargotti commented 1 year ago

targeting s+ (version 31 and above) requires that one of flag_immutable or flag_mutable

Hello, I'm facing the same problem with "react-native/messaging", I've already updated the libraries to the latest versions but the error continues

"@react-native-firebase/app": "16.4.6", "@react-native-firebase/crashlytics": "16.4.6", "@react-native-firebase/messaging": "16.4.6", "react-native": "0.64.1",

image

I made some changes to build.gradlew, according to some correction reports, but I couldn't identify a solution to the problem

image

Could you indicate any known solution or version to update?

benjaurr commented 1 year ago

I currently have this same issue. I can't upgrade to 16.x versions (they require to use_framework!, which makes other dependencies crash my app). However, im on the latest major version that doesn't use framework, 14.11.1. Is there any way to resolve this?

mikehardy commented 1 year ago

@benjaurr I am not aware of workarounds, the solution is to prioritize work with the other repos so that they are compatible with use_frameworks. I recognize that's potentially difficult but normally it is a problem related to header include paths - that is something structural as opposed to programmatic. Usually it can be fixed with changes to the affected module's podspec file.