[英]Android - google-service plugin conflict
Final solution 最终解决方案
I'm just an idiot. 我只是个白痴 Real problem after increasing version was, I had apply plugin not in the end of file.
增加版本后的真正问题是,我没有在文件末尾应用插件。 Check this topic , I was searching badly before
检查这个话题 ,我之前搜索不好
Original question 原始问题
I never understand how Gradle works, so sorry for stupid questions. 我从不了解Gradle的工作原理,非常抱歉提出愚蠢的问题。
I'm facing a problem and I have no idea what is wrong and what to do now. 我面临一个问题,我不知道哪里出了问题以及现在该怎么做。 I have app with GCM and everything worked fine until we added second language for app.
我在GCM上安装了应用程序,并且一切正常,直到我们为应用程序添加了第二种语言。
Then I get error, that google_app_id
is not translated - found that this is fixed in newer version of GCM package and I updated it to newer one. 然后我得到一个错误,即
google_app_id
未翻译-发现此问题已在GCM软件包的较新版本中修复,并将其更新为较新版本。 Now I get error 现在我得到错误
Error:Execution failed for task ':app:processDebugGoogleServices'.
错误:任务':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.
请通过更新google-services插件的版本来解决版本冲突(有关最新版本的信息, 请访问https://bintray.com/android/android-tools/com.google.gms.google-services/ )或将com.google.android.gms的版本更新为8.3.0。
But I updated it from 8.3.0 to 8.4.0 because of error with translation. 但是由于翻译错误,我将其从8.3.0更新到8.4.0。 My build.gradle files are like this
我的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'
}
and 和
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
}
}
Thank you 谢谢
This kind of issue happens when lint finds a string that is not traslated in all languages. 当lint查找并非所有语言都翻译过的字符串时,就会发生这种问题。 It should be fixed since 2.0.0-alpha3 .
自2.0.0-alpha3起应该将其修复。
You can use some workarounds: 您可以使用一些解决方法:
You can disable the MissingTranslation
in your build.gradle
file. 您可以禁用
MissingTranslation
在你build.gradle
文件。
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
}
}
Pay attention because it will disable all MissingTranslation error. 请注意,因为它将禁用所有MissingTranslation错误。
Otherwise you can use a lint.xml file with: 否则,您可以将lint.xml文件用于:
<lint>
<issue id="MissingTranslation">
<ignore regexp="google_app_id"/>
</issue>
</lint>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.