Javascript 无法从Android Studio生成react native,生成失败
安装react native fcm后,生成未成功。我不太确定要更改什么,我使用什么版本的谷歌服务 我的project grandle文件如下所示:Javascript 无法从Android Studio生成react native,生成失败,javascript,android,firebase,react-native,react-native-fcm,Javascript,Android,Firebase,React Native,React Native Fcm,安装react native fcm后,生成未成功。我不太确定要更改什么,我使用什么版本的谷歌服务 我的project grandle文件如下所示: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() google() } depend
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// Point to local maven repository
url "$rootDir/../.expo-source/android/maven"
}
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的项目/应用程序/grandle看起来像:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "fi.rogerstudio.possis"
minSdkVersion 19
targetSdkVersion 26
versionCode 2
versionName "1.0.2"
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
manifestPlaceholders = [
'appAuthRedirectScheme': 'fi.rogerstudio.possis'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "8g"
}
lintOptions {
abortOnError false
}
}
task exponentPrebuildStep(type: Exec) {
workingDir '../../'
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', '.\\.expo-source\\android\\detach-scripts\\prepare-detached-build.bat'
} else {
commandLine './.expo-source/android/detach-scripts/prepare-detached-build.sh'
}
}
preBuild.dependsOn exponentPrebuildStep
repositories{
flatDir{
dirs "../../node_modules/react-native-background-geolocation/android/libs"
}
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-vector-icons')
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.2'
compile 'com.google.android.gms:play-services:11.6.2'
compile 'com.google.android.gms:play-services-location:11.6.2'
compile 'com.google.android.gms:play-services-places:11.6.2'
compile 'com.google.android.gms:play-services-maps:11.6.2'
compile 'com.google.android.gms:play-services-ads:11.6.2'
compile('host.exp.exponent:expoview:22.0.0@aar') {
exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
exclude group: 'com.facebook.android', module: 'audience-network-sdk'
exclude group: 'io.nlopez.smartlocation', module: 'library'
transitive = true
}
compile ('com.facebook.android:facebook-android-sdk:4.+')
compile('com.facebook.android:audience-network-sdk:4.+') {
exclude module: 'play-services-ads'
}
compile('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
compile(project(':react-native-background-geolocation')) {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
compile(name: 'tslocationmanager', ext: 'aar') {
exclude group: 'com.google.android.gms'
}
compile "com.google.firebase:firebase-messaging:11.6.2"
}
apply plugin: 'com.google.gms.google-services'
我得到的错误是:
Error:Execution failed for task
app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.2.
我无法找到解决此问题的方法…这是错误:
错误:任务的执行失败
应用程序:ProcessDebuggGoogleServices’。
请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为11.6.2来修复版本冲突
您需要更改以下内容:
classpath 'com.google.gms:google-services:3.1.1'
到
或者将所有firebase版本更新为11.8.0,这是错误:
错误:任务的执行失败
应用程序:ProcessDebuggGoogleServices’。
请通过更新google services插件的版本(有关最新版本的信息,请访问)或将com.google.android.gms的版本更新为11.6.2来修复版本冲突
您需要更改以下内容:
classpath 'com.google.gms:google-services:3.1.1'
到
或者将所有firebase版本更新为11.8.0转到错误中提供的链接,显示google services版本3.1.2…您正在引用3.1.1。该错误是版本冲突。我会从那里开始。也许是其他原因,但这将是一个很好的起点。更新版本为3.1.2没有发生任何事情连接到错误中提供的链接显示google services版本3.1.2…您正在引用3.1.1。该错误是版本冲突。我会从那里开始。也许这是另外一回事,但这将是一个很好的起点。更新到3.1.2的版本没有发生任何事情