【问题标题】:Gradle error : Failed to resolve: com.google.firebase:firebase-core:16.0.1Gradle 错误:无法解决:com.google.firebase:firebase-core:16.0.1
【发布时间】:2018-11-21 04:04:50
【问题描述】:

编辑 请正确阅读我的问题,因为你说的是​​重复的,没有解决我的问题!

编辑 2 请我再说一遍,虽然这个问题的解决方案没有解决我的问题,为什么你一直说它重复?!!!!

我遇到了同样的问题:Failed to resolve: com.google.firebase:firebase-core:16.0.1 我已经按照答案做了一切!但问题仍然存在!

这是我的 gradle 项目级别

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()


    }

    dependencies {


        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'

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

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()

    }
}

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

这是我的 gradle 应用级别:

plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.0'
}

apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
    maven { url 'https://maven.google.com' }
}

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.miran3ma.wequest"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
         testInstrumentationRunner     "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true

        manifestPlaceholders = [onesignal_app_id               : "my-id",
                                   dashboard, local value is ignored.
                                onesignal_google_project_number: "REMOTE"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.onesignal:OneSignal:3.8.4'

    implementation('com.github.thekhaeng:pushdown-anim-click:1.0.7') {
        exclude group: 'com.android.support'
    }

    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.valdesekamdem.library:md-toast:0.9.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'net.steamcrafted:load-toast:1.0.12'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'me.grantland:autofittextview:0.2.1'
    // implementation 'com.wang.avi:library:2.1.3'

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'

    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

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

只有在更新到最新的 Firebase 版本 16 后才会出现此问题。

任何帮助将不胜感激,谢谢

【问题讨论】:

  • 它不是重复的!请阅读我的问题,因为答案没有解决我的问题!
  • 如果还是同一个问题,就不要再问了。如果它与其他问题不同,您不应只粘贴链接来描述您的问题,而应用您自己的话进行描述。
  • 清理并重建您的项目
  • 去掉了授权和数据库,还是一样!我认为现在我应该坚持使用第 15 版!

标签: android firebase gradle dependencies


【解决方案1】:
allprojects {
    repositories {
        jcenter()
        // Add this code block on your app
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}

【讨论】:

  • 已经尝试过这个解决方案,但仍然出于某种原因,gradle 假定我使用的是更高版本,请参阅:GradleError
  • 我也遇到过类似的问题。当我安装当前版本的 android studio 时问题得到解决。我可以推荐给你。
  • 顺便说一下,在新版本中它已被替换为编译字实现。
  • 我用的是最新版的android studio,一切都是最新的,即使我朋友也有同样的问题,它的实现,看我上面的Gradle代码
  • 你能把你的项目发给我吗?也许我可以更好地帮助你。
【解决方案2】:

仅针对遇到相同问题的人,它与 OneSignal 库导入有关。 只需阅读有关添加它的最新 onesignal 文档,这样 gradle 和错误就会消失。

【讨论】:

    猜你喜欢
    • 2018-11-08
    • 2023-04-10
    • 2023-03-29
    • 2019-04-16
    • 2020-02-25
    • 1970-01-01
    • 2022-01-10
    • 1970-01-01
    • 2017-11-15
    相关资源
    最近更新 更多