2016-04-04 2 views
2

Окончательное решениеAndroid - Google-сервис плагин конфликт

Я просто идиот. Реальная проблема после увеличения версии была, я применил плагин не в конце файла. 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:[email protected]') { 
     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 
    } 
} 

Спасибо

ответ

0

Такого рода проблема возникает, когда ворса находит строку, которая не во всех Перевод под языках. Он должен быть исправлен с 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> 
+0

Спасибо, что причина, почему я попытался 2.0.0-alpha6, но потом я сталкиваюсь другая проблема .. Должен ли я перейти обратно и использование что для игнорирования ошибки MissingTranslation? – Arxeiss

+0

Я бы не отказался от версии. Попробуйте использовать ignore с альфа6. –