错误:(41,13)无法解决:com.google.android.gms:play-services-appindexing:10.0.1
这是我在Android Studio中的项目的build.gradle文件,错误突然出现。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.pandey.nidhiiot"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-appindexing:10.0.0'
testCompile 'junit:junit:4.12'
apk 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:25.1.1-beta1'
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
}
apply plugin:'com.google.gms.google-services'
最佳答案
引用此post,您应该删除
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
因为使用下面的新库依赖关系就足够了。
compile 'com.google.firebase:firebase-appindexing:10.0.0'
我复制了gradle文件的一部分以获得依赖关系,并且遇到了相同的情况。在删除重复项(
compile 'com.google.android.gms:play-services:10.0.1'
)并如上所述替换依赖项之后,构建成功。dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
testCompile 'junit:junit:4.12'
apk 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:25.1.1-beta1'
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
}
关于android - 我突然在Gradle的Android Studio中收到Play-Service-app-indexing:10.0.1错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42508626/