的Android 2.2.2工作室面臨運行時錯誤不止一個庫包名「com.google.android.gms」
說默認依賴= compile 'com.google.android.gms:play-services:9.8.0'
我面臨的運行時此錯誤:
Error:java.lang.RuntimeException: Error: more than one library with package name 'com.google.android.gms'
。
當我試圖用我需要在我的項目中減少執行時間的特定依賴項替換默認播放服務依賴項。
這裏是我的應用程序級別gradle這個文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
applicationId "com.blucursor.gpstrack"
minSdkVersion 19
targetSdkVersion 23
multiDexEnabled true
versionCode 16
versionName "2.0"
resConfigs "en", "fr"
}
signingConfigs {
release {
storeFile file("C:\\******\\********.jks")
storePassword "********"
keyAlias "*******"
keyPassword "******"
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
zipAlignEnabled true
}
}
}
dependencies {
compile files('libs/android-query-full.0.26.8.jar')
compile files('libs/GraphView-4.0.1.jar')
//compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.google.android.gms:play-services-maps:9.8.0'
compile 'com.google.android.gms:play-services-gcm:9.8.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.moxun:tagcloudlib:1.1.3'
compile 'io.realm:realm-android:0.84.1'
}
apply plugin: 'com.google.gms.google-services'
這裏的項目級別gradle這個文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
當我建立與默認這工作正常,一個即: compile 'com.google.android.gms:play-services:9.4.0'
我試過的: 我跟蹤的來源。
- Error: more than one library with package name 'com.google.android.gms'
- Gradle: Error: more than one library with package name 'com.google.android.gms'
- This解決方案讓我非常接近我想要的東西我試圖刪除已生成的文件夾(拉梅的事情)和清潔,搖籃同步,無效緩存重新啓動,但沒有成功。
我見過很多解決方案,說你要麼使用播放服務依賴或特定的依賴。 我試圖做同樣的事情,但它似乎並不適合我。 有幫助嗎?
編輯:即使我刪除所有的Play商店依賴關係,仍然存在相同的錯誤。
我也試過更新app.iml文件,並刪除了其他不需要該項目的playstore依賴項,但這仍然不起作用。
您是否嘗試過讓Firebase使用與播放服務相同的版本? –
是的,我也試過,但沒有成功。 – VishAl
那麼,正如你鏈接指出的那些問題,你應該能夠使用命令行 –