2016-10-23 49 views
0

我试图在使用Maven回购的项目中包含JWPlayer。问题是图书馆的冲突与com.google.android.gms:play-services-auth:9.6.1Android JWPlayer与Play服务发生冲突

错误消息:

All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 9.6.1, 8.3.0. Examples include com.google.android.gms:play-services-basement:9.6.1 and com.google.android.gms:play-services-ads:8.3.0 

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.) 

我尝试使用以下行排除库,但没有奏效

compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:+') { 
    exclude module('com.google.android.gms:play-services-auth:8.3.0') 
} 

任何想法如何解决这个问题?

的build.gradle内容:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "24.0.2" 

    defaultConfig { 
     applicationId "xxxxxxxxxxxxx" 
     minSdkVersion 19 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    dataBinding { 
     enabled = true 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:25.0.0' 
    compile 'com.android.support:design:25.0.0' 
    compile 'com.google.firebase:firebase-core:9.6.1' 
    compile 'com.google.firebase:firebase-database:9.6.1' 
    compile 'com.google.firebase:firebase-crash:9.6.1' 
    compile 'com.google.firebase:firebase-auth:9.6.1' 
    compile 'com.google.firebase:firebase-messaging:9.6.1' 
    compile 'com.google.android.gms:play-services-auth:9.8.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.15.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.google.android.exoplayer:exoplayer:r2.0.1' 
    compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:+'){ 
     exclude group: 'com.android.support' 
     exclude group: 'com.google.android.gms' 
    } 
} 

apply plugin: 'com.google.gms.google-services' 

回答

2

首先,你必须阅读jwplayer的pom:那里你可以找到你所依赖的相关性的列表。然后你可以决定排除这些模块:

compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:+') { 
    exclude module: 'appcompat-v7' 
    exclude module: 'play-services-ads' 
} 

或团体:

compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:+') { 
    exclude group: 'com.android.support' 
    exclude group: 'com.google.android.gms' 
} 

或一组的模块:

compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:+') { 
    exclude group: 'com.android.support', module: 'appcompat-v7' 
    exclude group: 'com.google.android.gms', module: 'play-services-ads' 
} 

根据您的需要。

+0

很满意pom的建议,真的很有帮助!问题是构建仍然失败,出现另一个错误:'错误:执行任务失败':app:processDebugGoogleServices'。 >请通过更新google-services插件的版本或将com.google.android.gms的版本更新为9.6.1来修复版本冲突。“任何想法为什么? –

+0

是的,我尝试了以上所有 –

+0

我已经发布build.gradle内容 –

相关问题