【问题标题】:ERROR: Failed to resolve: com.google.firebase:firebase-core:17.3.99错误:无法解决:com.google.firebase:firebase-core:17.3.99
【发布时间】:2020-02-25 11:58:56
【问题描述】:

我在codecanyon买了这个应用代码,但是作者没有回答。这就是我在这里问的原因。我不了解android,我只是按照他们的教程进行操作。这是我的问题。有谁能帮忙吗?

gradle 版本
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

这是我遇到的错误

错误:无法解决:com.google.firebase:firebase-core:17.3.99
在项目结构对话框中显示
受影响的模块:app

错误:无法解决:com.google.android.gms:play-services-ads:17.3.99
在项目结构对话框中显示
受影响的模块:app

错误:无法解决:com.google.firebase:firebase-messaging:17.3.99
在项目结构对话框中显示
受影响的模块:app

错误:无法解决:com.google.android.gms:play-services-location:17.3.99
在项目结构对话框中显示
受影响的模块:app

错误:无法解决:com.google.android.gms:play-services-ads-identifier:17.3.99
在项目结构对话框中显示
受影响的模块:app

错误:无法解决:com.google.android.gms:play-services-base:17.3.99
在项目结构对话框中显示
受影响的模块:app

【问题讨论】:

标签: android firebase google-play-services


【解决方案1】:

这里https://firebase.google.com/support/release-notes/android,有最新的firebase版本。关于 firebase-core,最新版本是 17.2.1。 正如我在您的应用程序级别 build.gradle 中看到的那样,您对依赖项使用“编译”,您应该通过实现更改所有这些编译并将您的依赖项版本更新为这样的最新版本

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.1'
    implementation 'com.squareup.okhttp3:okhttp:4.2.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.okhttp:okhttp:2.2.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.stetho:stetho:1.1.1'
    implementation 'com.facebook.stetho:stetho-okhttp:1.1.1'
    implementation 'com.github.bumptech.glide:glide:3.7.0'

    implementation 'com.google.firebase:firebase-core:17.2.1'
    implementation 'com.onesignal:OneSignal:3.12.2'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'org.jsoup:jsoup:1.10.1'
    implementation 'com.google.android.gms:play-services-ads:18.2.0'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'

}

您还应该使用最新版本的 google-services ;更新您的项目级 build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.3.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

在 gradle.properties 文件中更新 gradle 版本:

#Mon May 21 12:39:33 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

你可以在这里找到所有的 firebase 设置https://firebase.google.com/docs/android/setup

【讨论】:

  • 如果我将 fire 基础版本更改为 17.3.99 到 17.2.1 是否可以使用?还是需要做任何额外的事情?
  • 通常它会起作用,但对你来说最好的方法是在这里上传你的 gradlew 文件,我们可以看看是否没有更多问题
  • 您好,我不了解android我在codecanyon购买了这个源代码,但作者没有回答。我没有时间,如果不介意你能改变它,我必须制作这个应用程序,请这是我谦虚的要求。或者有任何视频教程如何改变这个我休闲
  • 我为您提供了解决问题所需的一切,您只需编辑两个文件,如果您无法做到这一点,我将无法制作更多的东西以供使用。祝你有美好的一天
  • 我明白,我已经删除了回复中的第一行。您只需将第一部分代码放在 src/app/build.gradle 的依赖项部分(称为“应用程序级 build.grable 文件”),将第二部分代码放在 src/build.gradle 的依赖项部分(称为“项目级 build.gradle 文件)。它会起作用的。项目中的所有依赖项始终位于两个 build.gradle 文件中。
猜你喜欢
  • 1970-01-01
  • 2018-11-21
  • 1970-01-01
  • 1970-01-01
  • 2022-01-10
  • 1970-01-01
  • 2017-11-15
  • 2021-04-20
  • 2018-11-08
相关资源
最近更新 更多