无法解决:`com.google.android.gms:play-services-appindexing:10.0.0`

Kri*_*ena 31 android android-app-indexing

设置compile 'com.google.android.gms:play-services-appindexing:10.0.0'它时会出现以下错误:

Error:(82, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.0
Run Code Online (Sandbox Code Playgroud)

并在设置compile 'com.google.android.gms:play-services-appindexing:9.8.0'它时给出以下错误:

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.0.0.
Run Code Online (Sandbox Code Playgroud)

如果有人能告诉我这是错误的,那将是非常感激的,因为休息游戏服务版本10.0.0正常工作.

我的build.gradle文件

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.22.0'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    signingConfigs {

    }
    compileSdkVersion 25
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 41
        versionName "2.2.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            signingConfig signingConfigs.config
        }
    }
    lintOptions {
        checkReleaseBuilds false
    }
}

configurations {
    compile.exclude group: 'stax'
    compile.exclude group: 'xpp3'
}

repositories {
    maven {
        url "http://dl.bintray.com/microsoftazuremobile/SDK"
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    //Microsoft azure
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile files('libs/notification-hubs-0.4.jar')

    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:palette-v7:25.0.1'

    compile 'com.google.android.gms:play-services-auth:10.0.0'
    compile 'com.google.android.gms:play-services-maps:10.0.0'
    compile 'com.google.android.gms:play-services-analytics:10.0.0'
    compile 'com.google.android.gms:play-services-gcm:10.0.0'
    compile 'com.google.android.gms:play-services-appindexing:10.0.0'
    compile 'com.google.android.gms:play-services-base:10.0.0'

    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.android.support:multidex:1.0.1'

    //Facebook SDK
    compile 'com.facebook.android:facebook-android-sdk:4.17.0'

}

apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

小智 38

您正在寻找的appindexing库现在处于新的gradle目标之下.

你想添加compile 'com.google.firebase:firebase-appindexing:10.0.0'到你的应用程序的build.gradle文件:)

您可以在此处查看最新的库.


Kri*_*ena 26

现在Google Play Services版本10.0.1已经发布,因此请更换此版本 compile 'com.google.android.gms:play-services-appindexing:10.0.0'

通过 compile 'com.google.firebase:firebase-appindexing:10.0.1'


O'K*_*iye 12

嗨,无论何时遇到此类错误,首先要做的是检查您的Android Studio中是否安装了最新版本的google存储库.我有同样的问题,并在更新后,一切正常.希望能帮助到你.


And*_*der 5

我必须做两件事。加:

compile 'com.google.firebase:firebase-appindexing:10.0.0'
Run Code Online (Sandbox Code Playgroud)

这显然是新的。现在,此API在所有Google Play服务设置API中被列为唯一的Firebase API 还要删除play-services-appindexing此API替代的编译器:

//no longer include 'play-services-appindexing' compile
//compile 'com.google.android.gms:play-services-appindexing:10.0.0
Run Code Online (Sandbox Code Playgroud)

play-services-ads按照文档的指示,几个月前我第一次安装firebase服务时就删除了编译,尽管包括它不会像play-services-appindexing现在包含的那样使项目编译崩溃。

上载发行版apk时,不幸的是,在升级我的SDK和添加firebase-appindexing编译后,现在发现三个权限已添加到所需的权限中。这些不在我的清单中:

android.permission.READ_EXTERNAL_STORAGE,
android.permission.READ_PHONE_STATE, and
android.permission.WRITE_EXTERNAL_STORAGE
Run Code Online (Sandbox Code Playgroud)

编辑12/9/16:如Gaurav所评论,play-services version 10.0.1消除了READ_PHONE_STATE, READ_EXTERNAL_STORAGE, and WRITE_EXTERNAL_STORAGE,我希望从清单合并版本中得到的结果的“危险”权限。10.0.0.这些权限会调用一个特殊的对话框,该对话框会阻止用户继续使用您的应用程序(“这个游戏试图接管我的手机吗?')。如果您使用Firebase编译,请确保也将所有这些升级10.0.1。它们不会像播放服务那样变灰,这是应用程序gradle升级警告中的不幸不一致之处。如果您忽略升级firebase编译以匹配play-services编译,则会得到臭名昭著的“在使用play-services项目编译后无法访问zzanb”-Firebase Error在使用play-services-xxx:9.8.00后无法访问zzanb