简体   繁体   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

Error:(41, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.1 错误:(41,13)无法解决: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. 这是我在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'

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 还要检查将firebase-appindexing更改为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. 我复制了gradle文件的一部分以获取依赖关系,并且遇到了相同的情况。 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. 删除重复项( 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'

}

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'

暂无
暂无

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

相关问题 运行我的应用程序时,我在android studio中收到此错误 - I am getting this error in android studio while running my app 我在android studio上遇到了奇怪的错误 - I am getting strange error on android studio 我正在编写我的第一个 Android 应用程序,我突然收到一页又一页的错误消息,我无法理解 - I am writing my first Android app and I am suddenly getting pages and pages of error messages that I can't make head or tail of 为什么我在 flutter android 项目中收到 gradle 错误? - Why I am getting gradle error in flutter android project? 取得Android Studio Gradle错误 - Getting Android Studio Gradle Error 当我使用 capacitorjs 将 reactjs web 应用程序转换为移动应用程序时,我在 android studio 中遇到错误 - When i convert reactjs web application to mobile app using capacitorjs I am getting error in android studio Android gradle构建突然在':app:mergeDebugResources'上失败,没有错误消息 - Android gradle build fails suddenly on ':app:mergeDebugResources' with no error messages 在 android 工作室中运行 react-native 应用程序时出现此错误 - I am getting this error while running react-native app in android studio 当我在 class Android Studio 中从 firestore 获取数据时,为什么我的应用程序出错 - Why does my app error when I am Getting data from firestore in class Android Studio 我正在尝试在 android studio 中运行 AR 应用程序,但是在添加片段时出现错误“缺少约束和未知片段” - I am trying to run AR app in android studio but, while adding fragment i am getting error "missing constraint and unknown fragment"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM