错误:无法解决:com.google.android.gms:play-services-flags:12.0.1

时间:2019-07-05 08:58:00

标签: android firebase gradle

我正在尝试将Firebase添加到我的项目中。但我无法...此错误正在显示此错误。我通过工具> Firebase来实现firebase。.

请帮助我...

这是我的const mapStateToProps = (state) => { return { logged: state.logged } }

build.gradle

}

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

android {
compileSdkVersion 28
buildToolsVersion "29.0.0"
defaultConfig {
    applicationId "com.example.truckapp"
    minSdkVersion 23
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android- 
 optimize.txt'), 'proguard-rules.pro'
        multiDexKeepFile file('multidex-config.txt')
    }
}

}

这是我的错误消息:

  

错误:无法解决:com.google.android.gms:play-services-flags:12.0.1

编辑.. 这是我的存储库

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

//implementation 'com.google.android.libraries:1.1.0'
// implementation 'com.google.android.gms:play-services-places:11.0.0'
//implementation 'com.google.android.libraries.places:places:1.1.0'
//    implementation 'com.google.android.libraries.places:places:1.1.0'
//    implementation 'com.google.android.libraries.places:places- 
 compat:1.1.0'
 implementation 'com.android.support:multidex:1.0.3'

}

我刚刚删除了firebaseAuth依赖项,它构建成功。但是我需要使用firebase。我该怎么办?

请有人帮我

1 个答案:

答案 0 :(得分:0)

更改此:

  buildscript {
    repositories {
    maven {
        url "https://maven.google.com"
    }
    maven {
        url "https://jitpack.io"
    }
    jcenter()
    google()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.0-alpha03'
    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
  }
}

对此:

  buildscript {
    repositories {
     google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.0-alpha03'
    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
  }
}
apply plugin: 'com.google.gms.google-services'

apply plugin: 'com.google.gms.google-services'的末尾添加build.gradle,并将google()存储库放在jcenter()存储库之前。