繁体   English   中英

我突然在Gradle的Android Studio中收到Play-Service-app-indexing:10.0.1错误

[英]I am Suddenly getting Play-Service-app-indexing:10.0.1 error in gradle of android Studio

错误:(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'

你有

compile 'com.google.firebase:firebase-appindexing:10.0.0'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'

检查是否仅需要其中之一。 还要检查将firebase-appindexing更改为10.0.1

提及此帖子 ,您应该删除

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'

}

试试这个可能会有所帮助

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'
  compile 'com.google.android.gms:play-services:10.0.1'
  compile 'com.google.android.gms:play-services-appindexing:10.0.1'
  compile 'com.google.firebase:firebase-appindexing:10.0.1'
  compile 'com.android.support:support-v4:25.1.0'
  testCompile 'junit:junit:4.12'
// Glide image library
  compile 'com.github.bumptech.glide:glide:3.7.0'


   }

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM