gpt4 book ai didi

android - 更新 Gradle 依赖后无法解决

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:55:08 26 4
gpt4 key购买 nike

将 gradle 更新到最新的依赖项后,包含 firebase 和 play 服务:

配置“compile”已过时,已被“implementation”和“api”取代。

它将在 2018 年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

解析失败:play-services-base打开文件

未能解决:播放服务任务打开文件

解析失败:play-services-stats打开文件

解析失败:play-services-ads-identifier打开文件

解析失败:play-services-basement打开文件

build.gradle(app)

implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'

我该如何解决?

最佳答案

我解决了问题。这是解决方案

1.add google() before jcenter()
2.exclude group:"com.google.android.gms" in facebook sdk dependencies

我的代码 Gradle :

buildscript {
repositories {
google()
jcenter()
}

// something here ...

dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "io.realm:realm-gradle-plugin:3.1.1"
classpath 'com.google.gms:google-services:4.0.1'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

和 Myapp/gradle :

repositories {
maven { url 'https://maven.fabric.io/public' }
google()
jcenter()
}

dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true
}

implementation ('com.facebook.android:account-kit-sdk:4.28.0'){
exclude group:"com.google.android.gms"
}
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'

implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.4'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/glide-3.8.0.jar')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.squareup.okhttp:okhttp-urlconnection:2.3.0') {
exclude group: 'com.squareup.okhttp', module: 'okhttp'
}
implementation('com.squareup.okhttp:okhttp:2.3.0') {
exclude group: 'com.squareup.okio', module: 'okio'
}
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.android.support:exifinterface:27.1.1'

implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'

implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'

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

关于android - 更新 Gradle 依赖后无法解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50812362/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com