我最近将Android Studio升级到3.1,我对版本冲突问题感到困惑。我的 Gradle 版本为4.4,而 Andoid插件版本为3.0.0。我尝试将其更改为3.1.1。它将恢复为之前版本的mumber。这对我来说很困惑,所以需要你的帮助。同步时,我在Build中获得以下消息。
版本冲突:
objIE.document.getElementsByClassName("market_commodity_orders_table")(4).getElementsByTagName("tr")(1).textContent
的build.gradle /应用
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.4.2.
的build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.globemaster.samples"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:design:27.0.0'
implementation 'com.payumoney.sdkui:plug-n-play:1.2.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
答案 0 :(得分:3)
最后移动此行 应用插件:' com.google.gms.google-services'
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.globemaster.samples"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//
//
}
apply plugin: 'com.google.gms.google-services'
在(app)build.gradle脚本的底部并重建项目。
注意: - 我认为它必须通过引用来做一些事情 尚未创建的依赖项。像打电话一样的东西 甚至在你宣布它之前的变量
答案 1 :(得分:0)
请在您的应用内置 gradle.file
中添加以下代码apply plugin: 'com.google.gms.google-services'
答案 2 :(得分:0)
我希望这对你有用
将您的类路径更改为3.1.1
classpath 'com.android.tools.build:gradle:3.1.1'
在app gradle文件中依赖后应用插件
apply plugin: 'com.google.gms.google-services'