ОШИБКА: не удалось разрешить: com.google.android.gms: play-services-flags: 12.0.1 - PullRequest
1 голос
/ 05 июля 2019

Я пытаюсь добавить FireBase в свой проект.но я не могу ... эта ошибка показывает эту ошибку. Я реализую firebase с помощью tools> Firebase ..

помогите мне, пожалуйста ...

вотmy 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')
    }
}

}

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'

}

Это мое сообщение об ошибке:

ОШИБКА: Не удалось разрешить: com.google.android.gms: play-services-flags: 12.0.1

edit .. вот мой репозиторий

  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
  }

}

Я только что удалил зависимость firebaseAuth, он просто успешно строится.но мне нужно использовать FireBase.что мне делать?

Кто-нибудь, помогите мне, пожалуйста

1 Ответ

0 голосов
/ 05 июля 2019

Измените это:

  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() хранилище.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...