-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase dependency updates are required to fix gradle v4+ builds #1155
Comments
+1 |
@iljadaderko @MariaSyed @openGeeksLab I've just pushed up support for this on a
You'll need to update a few things:
i)
Update Android libs to the latest specified here: https://firebase.google.com/support/release-notes/android#20180523 Note that |
I had the same issue, the culprit is Firebase-Core as well in addition to Auth as pointed out by @iljadaderko |
Breaks Android currently!!!! see invertase/react-native-firebase#1155
Hi, I am facing the same issue. Is there any update on this ? I am working on the build-issues branch which fixed the issue in android and want to know when it will be pushed to release. I would also like to know about the iOS status. |
@DeepaSriramRR , as a temporal workaround you can disable version check of the Google plugin. At the end of your android/app/build.gradle: com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true |
This has now been merged and will be part of our next release. |
remove com.google.gms.google-services plugin |
this is working - last libs form google dependencies {
// compile fileTree(include: ['*.jar'], dir: 'libs')
api "com.facebook.react:react-native:+" // From node_modules
api "com.android.support:support-v4:$supportVersion"
compileOnly('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
transitive = true
}
// compileOnly "com.google.android.gms:play-services-base:15.0.1"
compileOnly "com.google.firebase:firebase-ads:15.0.1"
compileOnly "com.google.firebase:firebase-auth:16.0.2"
compileOnly "com.google.firebase:firebase-config:16.0.0"
compileOnly "com.google.firebase:firebase-core:16.0.1"
compileOnly "com.google.firebase:firebase-crash:16.0.1"
compileOnly "com.google.firebase:firebase-database:16.0.1"
compileOnly "com.google.firebase:firebase-firestore:17.0.2"
compileOnly "com.google.firebase:firebase-functions:16.0.1"
compileOnly "com.google.firebase:firebase-invites:16.0.1"
compileOnly "com.google.firebase:firebase-storage:16.0.1"
compileOnly "com.google.firebase:firebase-messaging:17.0.0"
compileOnly "com.google.firebase:firebase-perf:16.0.0"
compileOnly 'me.leolin:ShortcutBadger:1.1.21@aar'
} |
@chrisbianca can you confirm if it is a part of 4.3.0? |
@hegelstad yes it will be part of v4.3.0 Loving
|
@Salakar I'm severely struggling with this issue. Using Do you have a minimal example of which versions that works together? These are my deps: dependencies {
implementation (project(':react-native-firebase')) {
transitive = false
}
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
implementation "com.google.firebase:firebase-firestore:17.0.2"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation (project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation project(':react-native-wheel-datepicker')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
} buildscript {
repositories {
maven {
url 'https://maven.google.com'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
name 'Google'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
mavenLocal()
mavenCentral()
jcenter()
}
} EDIT: My issues disappear when I remove react-native-maps from the dependencies. I'll investigate further. def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "12.0.4" to: def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "15.0.1" However i get a new error: Any ideas? I am running this version of RNFirebase: EDIT3: Fixed it by bumping react-native-firebase's messaging dep to |
ok, I had something similar scenario, my current react native firebase is:
The error basically address that some other module is also relaying on Google play service, and it might have a default version which is conflicting with the one
add above
|
I suggest you first check it: |
@yeomann @mowbell This does resolve the sync issue but this forces I'm getting an error in Logcat:
|
sorry but you might have something else. I am having no issue here @vikrantnegi also its not necessary that react native maps will just depends upon version 10. if you read the source of react native maps, you can see ternary statement saying use default if app doesn't specify google play service version |
Issue persist when integrating along with react-native google maps ,@vikrantnegi found a fix yet |
Having the same problem described by @vikrantnegi . App freezes on startup when the sync issue is solved by setting GooglePlayVersion to 15.0.1. I use google maps due to some other library on my project. |
@linux08 @Victorams Yes the issue get fixed by setting |
same problem buildscript {
} allprojects { ext { apply plugin: "com.android.application" import com.android.build.OutputFile /**
project.ext.react = [ apply from: "../../node_modules/react-native/react.gradle" /**
/**
android {
} dependencies {
} // Run this once to be able to run the application with BUCK apply plugin: 'com.google.gms.google-services' Error: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.2,16.0.2]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. |
worked for me after adding the following code to android/build.gradle
|
Can't get this working either :( |
In
ATM, I believe the tutorials specify 16.0.1 for firebase-core and 17.1.0 for firebase-messaging. Go to https://firebase.google.com/docs/android/setup and scroll to the bottom and match the (This apart from the |
I know this issue is closed, but I wanted to leave my own strategy for solving this problem so that perhaps it helps someone or someone can tell me a simpler way. If google is listening, you have little idea of the pain this has caused.... We use a large number of libraries that depend on google services and firebase. We don't control those libraries, and some are not well maintained. We could fork them all, but that is it's own form of terrible. The only way we could get everything to work together is three things:
Without 1) you get conflicts where the same library is being included twice. I think you get duplicate symbols and the like. Without 2) your program will fail at runtime because it can't find the libraries it needs. Without 3) it will fail to compile with messages like "The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]]..." My impression is that this error is coming from google's own gradle plugin. Gradle's dependency tree doesn't show these dependencies once you exclude them and that error comes from google? The solution here: #1155 (comment) only works if every underlying module you are using respects that config variable, which many (most?) do not. There must be an easier way!!! |
@mcorner I was hitting the same
Once I did that all the mismatched dependency errors went away. |
@mcorner 💯 It would be a huge help if you could just tell me what versions would work for me. These are the modules i need to use: Questions: in android/build.gradle: |
Following worked for me:
android/build.gradle:
|
@mpalmerlee That is only going to work in limited cases, where all of your modules respect that variable. Some do (stripe and google-signin seem to), but we use several libraries that do not. @gagangoku I think the key is that you used: Which does seem dangerous, but may be doing the same thing I did in the end anyway. I agree, Google has made this super hard. |
@mcorner : agreed. |
I have this error with |
I am facing the issue i have reported at here If some one can help it would be great stuck at this badly. its basically conflicts in react-native-maps vs react-native-firebase as if i remove maps it will work fine. |
still having this issue.. |
I was having this issue and after testing i just change on build.gradle from:
to
and now its working |
This resolved it: https://stackoverflow.com/a/51213879/933711 Move buildscript {
ext.kotlin_version = '1.2.50'
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
} and allprojects {
repositories {
google()
jcenter()
}
} |
What resolved this error for me was to add the following to the bottom of android/app/build.gradle
It would be nice to add this to the Docs |
@mpalmerlee thank you!!! that did the trick |
Instead of above line use, |
Issue
Google recently released gradle versions 3.3.0 and 3.3.1 that had bug in them related to multiple build types (like dev conflicting with prod etc...) they afterwards released gradle v4.0.0 and v4.0.1 with fixes, but these presented their own errors for outdated dependencies
In my case error was
None of my dependencies are using it, after inspecting my dependency tree via
$ ./gradlew app:dependencies
I found out that this particular module is coming from firebase-auth
I created a stack-overflow issue and basically only suggestion was to make sure that firebase modules are up to date.
Looking at last 2 updates from firebase: https://firebase.google.com/support/release-notes/android#20180523 I updated ones I have inside my projects
app/build.gradle
to all the latest ones, but error persisted, I believe because these are not upgraded inreact-native-firebase
? Fix was to use gradle 3.2.1 for now.A side question: do we need to specify these firebase packages in
react-native-firebase
, i.e. will they not be inherited from parent project?Environment
The text was updated successfully, but these errors were encountered: