最终解决方案
我只是个白痴增加版本后的真正问题是,我没有在文件末尾应用插件。 Check this topic,我之前搜索不好
原始问题
我从不了解Gradle的工作原理,因此对愚蠢的问题感到抱歉。
我面临一个问题,我不知道哪里出了问题以及现在该怎么做。
我在GCM上安装了应用,并且一切正常,直到我们为应用添加了第二种语言。
然后我得到一个错误,即google_app_id
没有翻译-发现它在GCM软件包的较新版本中已得到修复,我将其更新为较新的版本。现在我得到错误
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 8.3.0.
但由于翻译错误,我将其从8.3.0更新为8.4.0。我的build.gradle文件是这样的
apply plugin: 'com.google.gms.google-services'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile "com.google.android.gms:play-services-gcm:8.4.0"
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'org.apmem.tools:layouts:1.10'
}
和
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
谢谢
最佳答案
当lint查找并非所有语言都翻译过的字符串时,就会发生这种问题。
自2.0.0-alpha3以来应予以修复。
您可以使用一些解决方法:
您可以在MissingTranslation
文件中禁用build.gradle
。
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
}
}
请注意,因为它将禁用所有MissingTranslation错误。
否则,您可以将lint.xml文件用于:
<lint>
<issue id="MissingTranslation">
<ignore regexp="google_app_id"/>
</issue>
</lint>
关于android - Android-Google-Service插件冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36395154/