-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Compatibility with react-native-firebase Error: more than one library with package name 'com.google.android.gms.license'
#682
Comments
Hey mate, I got same library as yours. I tried your suggestion. Now I could successfully build for Android. I changed the buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.library'
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "+"
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion" // double quote for merge field
compile 'me.leolin:ShortcutBadger:1.1.8@aar'
} And in the main project dependencies {
...
def googlePlayServicesVersion = project.googlePlayServicesVersion
compile(project(':react-native-maps')){
exclude group: 'com.google.android.gms'
}
compile 'com.google.android.gms:play-services-base:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile ('com.google.android.gms:play-services-gcm:11.8.0') {
force = true;
}
compile(project(':react-native-device-info')) {
exclude group: 'com.google.android.gms'
}
compile(project(':react-native-push-notification')) {
exclude group: 'com.google.android.gms'
}
...
} Also I added the version in googlePlayServicesVersion=11.8.0 |
@zo0r could we get this as a fix? Is working like a charm! |
NICE! @compulsor I shall wait for a day or two before switching ;-) |
@aligfl yea I can't really wait, i've got a client that is expecting a PoC within a few days. Anyhow, glad I could help out! |
I love how this has caused to many projects to fail the build process... hope this change gets merged quickly |
Yep I'm also getting this very recently. Thanks for the heads up @opp100. |
@compulsor how can I pull down your forked repo using npm? |
@aligfl |
Thanks @compulsor! much appreciated. |
this fix worked for us, thanks so much! @zo0r would be great to merge this in so we can switch off the forked version |
@aligfl @stantoncbradley any time lads! |
It's worth adding that switching to a forked version is not necessary to fix this issue (temporarily). I simply added the following to
That covers me because I'm only using |
@MyGuySi That ain’t needed at all. Just declare |
@compulsor Sure but that means people having to switch their package over to your forked version, wait for this one to be updated and then switch back. Repeat that for every dependency you have that uses Google Play Services and then it just becomes much simpler to implement my alternative until all of your dependencies have been updated. |
Can somebody merge the fix and release a new version soon? |
Hello,
I'm trying to use this library along with
react-native-firebase
in my project.But when I try to compile, I'm getting the following error:
I believe your Android dependency
compile 'com.google.android.gms:play-services-gcm:+'
needs to support Gradle versioning, kinda like:https://github.com/rebeccahughes/react-native-device-info/blob/e2c877f461c4181113abb3ff8f6bb8dfe89de0fb/android/build.gradle#L30
so the clients have the option of explicitly setting a version for that dependency.
Other packages seem to be affected as well by this change:
react-native-device-info/react-native-device-info#365
The text was updated successfully, but these errors were encountered: