简体   繁体   中英

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

Error:(41, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.1

Here is my build.gradle file of my project in Android Studio, the errors has came suddenly.

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'

You have

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

Check if just one of them is necessary. Also check changing firebase-appindexing to 10.0.1

Referring to this post , you should remove

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

since using the new library dependency (below) should be enough.

compile 'com.google.firebase:firebase-appindexing:10.0.0'

I copied the part of your gradle file for dependencies and encountered the same. After removing the duplicate ( compile 'com.google.android.gms:play-services:10.0.1' ) and replacing the dependency as mentioned above, the build was successful.

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'

}

Try this may be helpful

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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