I have updated my prohect from v5 to latest firebase version , Now I am having issue with a React Native project for android platform. We searched about it and it is only for older version of firebase module for having manual installation. For this project its automatic installation but we are getting this issue for apk although working fine in simulator while development
Describe your issue here
![Uploading Error.jpeg…]()
Project Files
Android: android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = '33.0.2'
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
googlePlayServicesAuthVersion = "16.0.1"
kotlinVersion = "1.7.0"
versionCode = "6"
versionName = "1.0.7"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.3")
classpath 'com.google.gms:google-services:4.3.15'
classpath 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
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")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
maven { url 'https://www.jitpack.io' }
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
// NOTE: if you are in a monorepo, you may have "$rootDir/../../../node_modules/react-native/android"
url "$rootDir/../node_modules/react-native/android"
}
}
}
}
productFlavors {
dev {
applicationId "com.abcd.dev"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.abcd"
}
prod {
applicationId "com.abcd"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.abcd"
}
}
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('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
//signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// 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
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(com.android.build.OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
// 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'
}
#### `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
- [ ] 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`
Issue
I have updated my prohect from v5 to latest firebase version , Now I am having issue with a React Native project for android platform. We searched about it and it is only for older version of firebase module for having manual installation. For this project its automatic installation but we are getting this issue for apk although working fine in simulator while development
"react-native": "^0.67.5", "@react-native-firebase/app": "16.7.0", "@react-native-firebase/messaging": "16.7.0",
Describe your issue here ![Uploading Error.jpeg…]()
Project Files
Android:
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext { buildToolsVersion = '33.0.2' minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 ndkVersion = "21.4.7075529" googlePlayServicesAuthVersion = "16.0.1" kotlinVersion = "1.7.0" versionCode = "6" versionName = "1.0.7" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:7.1.3") classpath 'com.google.gms:google-services:4.3.15' classpath 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }
allprojects {
} `
android/app/build.gradle
apply plugin: "com.android.application" // apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" apply plugin: 'com.google.gms.google-services'/**
react-native bundle
with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle"
line.project.ext.react = [ enableHermes: false, // clean and rebuild if changing ]
apply from: "../../node_modules/react-native/react.gradle"
/**
/**
/**
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Date.toLocaleString
andString.localeCompare
that/**
Architectures to build native code for in debug. */ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") android { ndkVersion rootProject.ext.ndkVersion compileSdk rootProject.ext.compileSdkVersion
flavorDimensions "default"
//compileOptions { // sourceCompatibility JavaVersion.VERSION_1_8 // targetCompatibility JavaVersion.VERSION_1_8 //}
defaultConfig { applicationId "com.abcd" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 6 versionName "1.0.7" }
productFlavors { dev { applicationId "com.abcd.dev" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion resValue "string", "build_config_package", "com.abcd" } prod { applicationId "com.abcd" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion resValue "string", "build_config_package", "com.abcd" } } 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('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } release { if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) { storeFile file(MYAPP_UPLOAD_STORE_FILE) storePassword MYAPP_UPLOAD_STORE_PASSWORD keyAlias MYAPP_UPLOAD_KEY_ALIAS keyPassword MYAPP_UPLOAD_KEY_PASSWORD } } } buildTypes { debug { signingConfig signingConfigs.debug if (nativeArchitectures) { ndk { abiFilters nativeArchitectures.split(',') } } } release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. //signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" signingConfig signingConfigs.release } }
// 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 // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(com.android.build.OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi) }
} }
dependencies {
}
// 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)
AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.abcd">
.
Javascript
Click To Expand
#### `package.json`: { "name": "abcd", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "androiddev": "react-native run-android --variant=devDebug --appIdSuffix=dev", "androiddevprod": "react-native run-android --variant=prodDebug --appIdSuffix=prod", "ios": "react-native run-ios --simulator \"iPhone 11\"", "start": "react-native start", "test": "jest", "lint": "eslint .", "postinstall": "make post-install" }, "dependencies": { "@invertase/react-native-apple-authentication": "2.1.0", "@react-native-async-storage/async-storage": "^1.15.8", "@react-native-community/netinfo": "^7.0.0", "@react-native-community/push-notification-ios": "^1.11.0", "@react-native-firebase/app": "16.7.0", "@react-native-firebase/messaging": "16.7.0", "@react-native-google-signin/google-signin": "8.2.1", "@react-native-masked-view/masked-view": "^0.2.6", "@react-native-picker/picker": "1.14.0", "@react-navigation/bottom-tabs": "^5.11.8", "@react-navigation/native": "^5.9.8", "@react-navigation/stack": "^5.14.9", "@ubaids/react-native-material-textfield": "https://github.com/ubaidjs/react-native-material-textfield", "axios": "^0.21.1", "babel-plugin-transform-remove-console": "^6.9.4", "html-entities": "^2.3.3", "jwt-decode": "^3.1.2", "light-event-bus": "^1.0.1", "moment": "^2.29.1", "react": "17.0.2", "react-content-loader": "^6.0.3", "react-native": "^0.67.5", "react-native-config": "1.5.0", "react-native-deck-swiper": "https://github.com/webraptor/react-native-deck-swiper", "react-native-device-info": "8.1.3", "react-native-fast-image": "^8.3.4", "react-native-flash-message": "^0.1.23", "react-native-gesture-handler": "2.5.0", "react-native-globalspinner": "^2.0.2", "react-native-image-picker": "3.6.0", "react-native-keyboard-manager": "^6.5.11-0", "react-native-modal": "^13.0.0", "react-native-orientation-locker": "^1.3.0", "react-native-phone-number-input": "^2.1.0", "react-native-popup-menu": "^0.15.10", "react-native-push-notification": "^8.1.1", "react-native-reachability-popup": "^1.0.4", "react-native-reanimated": "2.4.0", "react-native-safe-area-context": "^3.2.0", "react-native-screens": "^3.2.0", "react-native-splash-screen": "^3.2.0", "react-native-svg": "^12.1.1", "react-native-swipe-list-view": "^3.2.7", "react-native-video": "^5.2.1", "react-native-video-controls": "^2.8.1", "react-native-webview": "^11.13.0", "react-redux": "^7.2.3", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", "redux-saga": "^1.1.3", "redux-storage": "^4.1.2", "redux-storage-decorator-filter": "^1.1.8", "version": "^0.1.2" }, "devDependencies": { "@babel/core": "^7.13.13", "@babel/runtime": "^7.13.10", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.23.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } } ```json # N/A ``` #### `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 - [ ] 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`
React Native Firebase
andInvertase
on Twitter for updates on the library.