2016-11-28 108 views
0

这是Gradle应用程序代码,它显示错误
无法编译
所以我拉我的头发没有得到错误。
请有人在这里平!错误:无法解析:com.google.firebase:firebase-appindexing:9.6.1

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.3" 

    defaultConfig { 
     applicationId "com.google.firebase.codelab.friendlychat" 
     minSdkVersion 16 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner   "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 

    compile 'com.android.support:design:24.2.1' 
    compile 'com.github.bumptech.glide:glide:3.6.1' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    compile 'com.android.support:appcompat-v7:24.2.1' 

    // Google 

    compile 'com.google.android.gms:play-services-auth:9.6.1' 


    // Firebase 

    compile 'com.google.firebase:firebase-database:9.6.1' 
    compile 'com.google.firebase:firebase-auth:9.6.1' 



    compile 'com.google.firebase:firebase-config:9.6.1' 
    compile 'com.google.android.gms:play-services-appinvite:9.6.1' 
    compile 'com.google.firebase:firebase-messaging:9.6.1' 
    compile 'com.google.android.gms:play-services-ads:9.6.1' 
    compile 'com.google.firebase:firebase-crash:9.6.1' 

    This line getting error please anybody get in touch 

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

} 

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

回答

3

我一直没能找到appindexing历史的解释,但着眼于快速启动项目为10.0.0的revision history之前,包名是不同的。试着在你的依赖使用此:

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

这个答案假定您使用的是预10.0.0 API的功能。 Migration Guide解释了这些差异。

+0

我的火基地API 9.6.1没有奏效。 – jsroyal

2

如果您正在使用火力地堡版本9.8.0或下面你要使用的形式com.google.android.gms:play-services-appindexing:<VERSION>。如果您使用的版本号为10.0.0或更高版本,则需要使用表格com.google.firebase:firebase-appindexing:<VERSION>。该名称已在版本10.0.0中更改。

如果你想这个时候得到一个“无法解决”的错误,更新您的谷歌Play服务SDK以下步骤: Failed to resolve: com.google.firebase:firebase-core:9.0.0

0

其实这是API错误和错误也报告给谷歌。 所以只是错误了。