2

Мой проект build.gradle зависимостей являются:исключение Gradle зависимость не работает

dependencies { 
    ... 
    compile 'com.google.code.gson:gson:2.3.1' 
    compile 'com.google.android.gms:play-services-maps:8.4.0' 
    compile 'com.google.android.gms:play-services-analytics:8.4.0' 
    compile 'com.google.android.gms:play-services-appinvite:8.4.0' 
    compile 'com.google.android.gms:play-services-gcm:8.4.0' 

    compile 'co.realtime:messaging-android:2.1.58' 
} 

И co.realtime: messageing-андроидаbuild.gradle зависимостей:

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile ('com.android.support:appcompat-v7:21.0.3'){ 
     transitive = true; 
    } 
    compile ('com.google.android.gms:play-services:6.1.71'){ 
     transitive = true; 
    } 
    compile ('com.googlecode.json-simple:json-simple:1.1'){ 
     transitive = true; 
    } 
} 

Если я пытаюсь скомпилировать мой проект Я получаю следующую ошибку:

Error:Gradle: Execution failed for task ':app-module:processProdDebugResources'. Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0

Если я использую enforceUniquePackageName(false) я получаю:

cannot resolve symbol to GoogleCloudMessaging.INSTANCE_ID_SCOPE

Так что я думаю, я должен решить эту проблему путем управления зависимостями. Я пробовал:

compile ('co.realtime:messaging-android:2.1.58'){ 
     exclude module: 'com.google' 
} 

compile ('co.realtime:messaging-android:2.1.58'){ 
     exclude group: 'com.google.android.gms', module: 'play-services-gcm' 
} 

Но ничего швов на работе ... Как я могу это решить?
Спасибо.

ответ

4

Проблема была в «плей-услуги-GCM» вместо «Play-услуг»

compile ('co.realtime:messaging-android:2.1.58'){ 
     exclude group: 'com.google.android.gms', module: 'play-services' 
} 

Grrr те опечатка ошибки ... Ну, я думал, что я мог бы удалить этот вопрос, но, один раз в то время у кого-то есть такая же проблема, поэтому я оставлю это здесь, надеясь, что это поможет кому-то в этом нуждается.