错误:无法解决:com.google.firebase:firebase-core:17.3.99

时间:2019-10-30 08:18:54

标签: android firebase google-play-services

我在codecanyon购买了此应用程序代码,但作者未回答。这就是为什么我在这里问。我不了解android,我只是在关注他们的教程。这是我的问题。谁能帮忙吗?

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

这是我遇到的错误

  

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

     

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

     

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

     

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

     

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

     

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

1 个答案:

答案 0 :(得分:0)

这里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

您可以在https://firebase.google.com/docs/android/setup

中找到所有的Firebase设置