--- I have build my app in android studio and got this warning
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/firestore' depends on
'@react-native-firebase/app' v7.1.4 but found v7.0.1, this might cause build issues or runtime
crashes.
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/functions' depends on
'@react-native-firebase/app' v7.2.1 but found v7.0.1, this might cause build issues or runtime
crashes.
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/storage' depends on
'@react-native-firebase/app' v7.1.4 but found v7.0.1, this might cause build issues or runtime
crashes.
I simply ignored this, and when now I am using the app I am not able to use google sign In service in the app, though I was able to use these services on the emulator by running npm run android
Package.json file
"@react-native-firebase/app": "^7.0.1",
"@react-native-firebase/auth": "^7.0.2",
"@react-native-firebase/firestore": "^7.1.2",
"@react-native-firebase/functions": "^7.1.3",
"@react-native-firebase/storage": "^7.1.2",
I have also tried 'yarn install' but I am getting the same warning.
android/app/build.gradle file
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.newproject"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true //for rn crop image
}
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'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
}
// 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 =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.google.firebase:firebase-analytics:17.2.2'
//adding firebase sdk
//adding auth dpendecy manually
implementation 'com.google.android.gms:play-services-auth:18.0.0'
//noinspection GradleDynamicVersion
//implementaion of react native image picker
implementation project(':react-native-image-picker')
implementation 'com.android.support:multidex:1.0.3'
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
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'
}
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.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "27.1.1"
googlePlayServicesAuthVersion = "16.0.1" // <--- use this version or newer
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.3')
// classpath 'com.android.tools.build:gradle:2.2.+'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
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")
}
maven { url 'https://maven.google.com' }
maven { url 'https://www.jitpack.io' }
}
}
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.newproject">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
Click To Expand
#### Have you converted to AndroidX? #### `android/build.gradle`: #### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
rootProject.name = 'newproject'
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
// include ':app'
include ':react-native-google-signin', ':app'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/google-signin/android')
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->
Click To Expand
**`react-native info` output:**
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 3.66 GB / 15.88 GB
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Users\user\AppData\Roaming\npm\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6392135
Languages:
Java: 1.8.0_211
Python: 3.8.0
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [x] Android
- [ ] **iOS** but have not tested behavior on Android
- [x] **Android** but have not tested behavior on iOS
- [ ] Both
You have to upgrade the /app package that you have installed
You have to upgrade the /app package that you have installed
I tried this yarn upgrade @react-native-firebase/app and still I am having 7.0.1 ver. of /app
Output of the command :
yarn upgrade v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @react-native-community/[email protected]" has unmet peer dependency "prop-types@*".
warning " > @react-native-firebase/[email protected]" has incorrect peer dependency "@react-native-firebase/[email protected]".
warning " > @react-native-firebase/[email protected]" has incorrect peer dependency "@react-native-firebase/[email protected]".
warning " > @react-native-firebase/[email protected]" has incorrect peer dependency "@react-native-firebase/[email protected]".
warning " > @react-native-firebase/[email protected]" has incorrect peer dependency "@react-native-firebase/[email protected]".
warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.7".
warning "@react-native-community/eslint-config > @typescript-eslint/[email protected]" has incorrect peer dependency "eslint@^5.0.0".
warning "@react-native-community/eslint-config > @typescript-eslint/[email protected]" has incorrect peer dependency "eslint@^5.0.0".
warning "@react-native-community/eslint-config > [email protected]" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
warning "@react-native-community/eslint-config > [email protected]" has incorrect peer dependency "eslint@^3.17.0 || ^4 || ^5".
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Rebuilding all packages...
success Saved lockfile.
success Saved 8 new dependencies.
info Direct dependencies
鈹斺攢 @react-native-firebase/[email protected]
info All dependencies
鈹溾攢 @react-native-firebase/[email protected]
鈹溾攢 @react-native-firebase/[email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹斺攢 [email protected]
Done in 36.33s.
yarn upgrade --latest will get you the latest
yarn upgrade --latestwill get you the latest
Thanks it worked and also I needed to update my Android Studio and its firebase plugin
I had a similar issue when working with @react-native-firebase/admob. Even yarn upgrade couldn't fix it. I manually reduced the version number of each firebase package by a minor version and it worked perfectly
@srujandeshpande downgrading is a sub-optimal, temporary solution at best. We issue new releases to fix bugs and forward port to new upstream firebase SDK features, you will want those changes.... There must be a root cause, and a full upgrade (e.g. yarn upgrade --latest) of all versions and then a npx react-native-clean-project should set you right.
Most helpful comment
yarn upgrade --latestwill get you the latest