android - Android-Google-Service插件冲突

标签 android gradle google-api google-cloud-messaging

最终解决方案

我只是个白痴增加版本后的真正问题是,我没有在文件末尾应用插件。 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/

相关文章:

php - 使用电子邮件审核(Admin SDK)下载邮箱

java - 为什么这个 ArrayList 将所有内容存储在第一个索引中?如何在 JSP 中从该数组列表动态加载图像 url?

android - 无法解析配置 ':app:_debugCompile' 的所有依赖项。 -Android工作室

android - Gradle - Windows 中缓存库的位置

javascript - 为什么我会收到gapi.client undefined 错误?

java - Gradle未配置用于FindBugs分析的类目录

java - IntelliJ Idea 与 Gradle : Best Practices

java - 如何在android中创建年龄计算方法的方法

Androidplot 如何隐藏绘图中的域值?

android - 创建自定义表单 java android