我的项目正在使用react-native-maps
和react-native-firebase
。
按照react-native-firebase
安装指南进行操作并进行同步。显示错误
其他[= [15.0.1,15.0.1]]的其他图书馆都在请求库com.google.android.gms:play-services-basement,但解析为10.2.4。
这是我的根build.gralde
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1' // I changed this to latest
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
我试图在gms
中排除react-native-maps
个模块。但这是行不通的。这是我的app/build.gradle
// ...
dependencies {
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation project(':react-native-image-picker')
implementation project(':react-native-i18n')
implementation project(':realm')
implementation project(':react-native-fast-image')
implementation fileTree(dir: "libs", include: ["*.jar"])
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'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
}
implementation project(':react-native-toast')
implementation "com.android.support:appcompat-v7:27.1.0"
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
implementation 'com.android.support:multidex:1.0.0'
implementation "com.facebook.react:react-native:+" // From node_modules
}
// 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 plugin: 'com.google.gms.google-services'
//GoogleServicesPlugin.config.disableVersionCheck = true <-- this is the only thing to make it works
到目前为止,我所做的唯一一件事就是禁用GooleServicePlugin
版本检查,但似乎不太正确。
请帮助。提前致谢。 :(