Android 未能解析:com.google.firebase:firebase存储公用:11.0.1
我正在升级我的Android Studio,Gradle版本2.3到2.3.3,还更新了我的sdk-API级别26、sdk构建工具26、Google Play服务41、Google存储库54 当我清理项目时,出现以下错误:Android 未能解析:com.google.firebase:firebase存储公用:11.0.1,android,firebase,gradle,firebase-storage,Android,Firebase,Gradle,Firebase Storage,我正在升级我的Android Studio,Gradle版本2.3到2.3.3,还更新了我的sdk-API级别26、sdk构建工具26、Google Play服务41、Google存储库54 当我清理项目时,出现以下错误:无法解析:com.google.firebase:firebase存储公共:11.0.1 build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 26
无法解析:com.google.firebase:firebase存储公共:11.0.1
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
}
def applicationVersion = '1.524 20170612'
dexOptions {
preDexLibraries = false
javaMaxHeapSize "2g"
}
...
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'build.gradle'
exclude 'build.xml'
exclude 'META-INF/jersey-module-version'
exclude 'META-INF/NOTICE'
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
}
dependencies {
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0.pr1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:11.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.android.gms:play-services-contextmanager:9.4.0'
compile 'com.google.android.gms:play-services-places:11.0.1'
compile 'com.google.android.gms:play-services-nearby:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.google.android.gms:play-services-analytics:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.3.0@aar'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-analytics:11.0.1'
compile 'com.flurry.android:analytics:6.4.2'
compile 'com.android.support.constraint:constraint-layout:+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
apply插件:“com.android.application”
安卓{
编译DK26版
buildToolsVersion“26.0.0”
默认配置{
明斯克版本16
targetSdkVersion 26
multiDexEnabled=true
}
def应用程序版本='1.524 20170612'
德克斯选项{
preDexLibraries=false
javaMaxHeapSize“2g”
}
...
useLibrary'org.apache.http.legacy'
包装选项{
排除“META-INF/许可证”
排除“META-INF/LICENSE.txt”
排除“META-INF/NOTICE.txt”
排除“build.gradle”
排除“build.xml”
排除“META-INF/jersey模块版本”
排除“META-INF/通知”
}
所有项目{
tasks.withType(JavaCompile){
options.compilerArgs确保来自组com.google.android.gms
和来自组com.google.firebase
的版本相同
例如,当前的最新版本是11.0.1,因此com.google.android.gms
和com.google.firebase
中的所有依赖项都应该有11.0.1版本。在依赖项列表中,以下两个都有不同的版本。确保它们也有11.0.1版本
为了实现这一目标
您将需要迁移
播放服务应用程序索引到Firebase应用程序索引。指南为
根据contextmanager,api已更改为。因此,您还需要相应地更新代码。由于GooglePlayService包中发生了一些更改,因此引发此错误。他们将一些类文件和方法移动到Firebase包中。
参考链接包括:
现在需要更改build.gradle文件上的一些项目链接
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
}
def applicationVersion = '1.20170612'
dexOptions {
preDexLibraries = false
javaMaxHeapSize "2g"
}
enter code here
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
buildTypes {
release {
minifyEnabled false
}
debug {
minifyEnabled false
}
}
}
dependencies {
compile project(':paymentGatewayCommons')
compile project(':paypal')
compile project(':paytm')
compile project(':payu')
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0.pr1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-base:11.0.1'
compile 'com.google.android.gms:play-services-cast-framework:11.0.1'
compile 'com.google.android.gms:play-services-places:11.0.1'
compile 'com.google.android.gms:play-services-nearby:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.google.android.gms:play-services-analytics:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-android-embedded:3.3.0@aar'
compile 'com.google.firebase:firebase-appindexing:11.0.1'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-analytics:11.0.1'
compile 'com.flurry.android:analytics:6.4.2'
compile 'com.android.support.constraint:constraint-layout:+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
还更改了主项目build.gradle文件
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Firebase说:
出现“找不到”错误?请确保
Android SDK管理器中的最新Google存储库
您可以检查您的Google存储库版本(在Linux中):
解决此问题的最佳方法不是使用手动方法将firebase链接到应用程序
我已经尝试通过引用这一点来添加最新的firebase回购协议
显示错误“无法解析依赖项”
FireBase建议在FireBase Assistant for Android Studio 2.2版及更高版本的帮助下将FireBase添加到您的应用程序中。手动添加最新库以生成gradle(模块)会导致如上所述的错误
使用Firebase助手非常简单,只需两个步骤。您可以在上面提到的同一链接上使用“使用Firebase助手”部分作为参考
我的安卓Studio 2.3.3真的很好用,.我的安卓Studio 2.3.3很好用,.我的安卓Studio 2.3.3很好用这些行依赖项{..编译'com.google.firebase:firebase消息:9.6.0'compile'com.google.firebase:firebase存储公用:9.6.0'testCompile'junit:junit:4.12}apply plugin:'com.google.gms.google services'//文件底部感谢Nandha对我的问题的回答。尝试过,但错误没有解决。您好BhalchadraSW,感谢您回答我的问题。当我检查硬盘时,Android/sdk/extras/google/m2repository/com/google/androd/gms/play服务appindexing:9.8.0是最新的下载版本aded版本。Android/sdk/extras/google/m2repository/com/google/Android/gms/play services contextmanager:9.4.0也是最新的下载版本。google没有提供11.0.1版本。我认为,因为您应该迁移到,并将contextmanager迁移到Yes,这对我来说是有效的。在我的情况下,vision包不一致,需要修改被激怒为:compile'com.google.android.gms:play services vision:11.0.1'