Error could not resolve all firebase dependencies unavailable invalid

[READ] For Firebase Unity SDK issues, please report to Firebase Unity open-source Once you've read this section and determined that your issue is appropriate for this repository, please delete ...

[READ] For Firebase Unity SDK issues, please report to Firebase Unity open-source

Once you’ve read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.3.11f1(LTS)
  • Firebase Unity SDK version: 8.7.0
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Auth
  • Other Firebase Components in use: Crashlytics, Analytics, Messaging
  • Additional SDKs you are using: Facebook, Google Sign In, Other SDK
  • Platform you are using the Unity editor on: Window
  • Platform you are targeting: Android, iOS
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

Calling FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread got DependencyStatus.UnavailableInvalid on some device

Steps to reproduce:

Got some log about the error in logging service (Record on 1 devices resulting that device cannot sign in using firebase auth)
Still could not reproduce on development environment and staging environment

Relevant Code:

FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(t =>
                {
                    var status = t.Result;
                    if (status == DependencyStatus.Available)
                    {
                        FirebaseApp app = FirebaseApp.DefaultInstance;
                        FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
                        isInitialized = true;
                        auth = FirebaseAuth.DefaultInstance;
                        FirebaseMessaging.SubscribeAsync(PortalSettings.GetPackageName()).ContinueWithOnMainThread(OnSubscribe);
                    }
                    else
                    {
                        Debug.LogError("Could not resolve all Firebase dependencies: " + status + "n" + t.Exception);
                    }
                });

I am getting this error when including the Firebase Auth library. This error only comes up if I include Firebase auth 11.8.0. Upon removing that, gradle builds successfully. Is there an incompatibility of the versions I use?

Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.company.myapp"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    def googleSupportVersion = '26.1.0'
    def googlePlayServicesVersion = '11.8.0'

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:appcompat-v7:$googleSupportVersion"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
    compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"
    compile "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
}
apply plugin: 'com.google.gms.google-services'

And:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}
allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

Error:

Error:Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.google.firebase:firebase-auth:11.8.0
Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-auth/11.8.0/firebase-auth-11.8.0.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-auth/11.8.0/firebase-auth-11.8.0.aar'.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
unable to find valid certification path to requested target

Я получаю эту ошибку при включении библиотеки Firebase Auth. Эта ошибка возникает, только если я включаю Firebase auth 11.8.0. После его удаления gradle успешно строится. Есть ли несовместимость используемых мной версий?

Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.company.myapp"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    def googleSupportVersion = '26.1.0'
    def googlePlayServicesVersion = '11.8.0'

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:appcompat-v7:$googleSupportVersion"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
    compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"
    compile "com.google.firebase:firebase-messaging:$googlePlayServicesVersion"
}
apply plugin: 'com.google.gms.google-services'

А также:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}
allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

Ошибка:

Error:Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.google.firebase:firebase-auth:11.8.0
Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-auth/11.8.0/firebase-auth-11.8.0.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-auth/11.8.0/firebase-auth-11.8.0.aar'.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
unable to find valid certification path to requested target

Привет, я новичок в firebase flutter, и я хочу сделать страницу входа в систему с аутентификацией с помощью firebase. и после того, как я сделаю страницу входа и все настройки из документации для firebase в мой проект, я получаю этот erorr. Я пробую pub clear cache, но это не решает проблему.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':firebase_core:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':firebase_core:debugCompileClasspath'.
   > Could not find com.google.firebase:firebase-common:.
     Required by:
         project :firebase_core 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 16s
Exception: Gradle task assembleDebug failed with exit code 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 16s
Exception: Gradle task assembleDebug failed with exit code 1

Это мой pubspec.yaml с последней версией firebase

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  
  flutter:
    sdk: flutter
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0
  google_fonts: ^1.1.0
  flutter_svg: ^0.18.0
  animate_icons: ^1.0.0
  motion_tab_bar: ^0.1.5
  simple_animations: ^1.3.3
  #firebase
  firebase_core: ^0.7.0
  firebase_analytics: ^7.0.1
  firebase_auth: ^0.20.1
  cloud_firestore: ^0.16.0+1
  provider: ^4.3.3

dev_dependencies:
  flutter_test:
    sdk: flutter

Приложение / build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'  // Google Services plugin

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "id.skyward.plantgo"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
            minifyEnabled true
        }
        debug {
            minifyEnabled true
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:26.5.0')

  // Add the dependency for the Firebase SDK for Google Analytics
  // When using the BoM, don't specify versions in Firebase dependencies
    implementation 'com.google.firebase:firebase-analytics'

  // Add the dependencies for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-firestore'
}

rootProject.ext {
  set('FlutterFire', [
    FirebaseSDKVersion: '25.12.0'
  ])
}

Build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5' // Google Services plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

2 ответа

Лучший ответ

UPDATE

Я нашел на это ответ. в файлах app/build.gradle эта строка FirebaseSDKVersion: '25.12.0' является проблемой. Это должна быть такая же версия с implementation platform('com.google.firebase:firebase-bom:26.5.0') поэтому я перехожу на FirebaseSDKVersion: '25.12.0', а затем работаю с ядром firebase.


0

skyward17
16 Мар 2021 в 04:43

Я обновил ваш файл app/build.gradle, попробуйте это.

Я только что добавил одну строчку implementation 'com.google.firebase:firebase-core:17.0.1'.

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'  // Google Services plugin

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "id.skyward.plantgo"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
            minifyEnabled true
        }
        debug {
            minifyEnabled true
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:26.5.0')

  // Add the dependency for the Firebase SDK for Google Analytics
  // When using the BoM, don't specify versions in Firebase dependencies
    implementation 'com.google.firebase:firebase-analytics'

  // Add the dependencies for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-firestore'
    implementation 'com.google.firebase:firebase-core:17.0.1'

}

rootProject.ext {
  set('FlutterFire', [
    FirebaseSDKVersion: '25.12.0'
  ])
}


0

Harsh Chovatiya
23 Фев 2021 в 05:54

I have created a Firestore Project in Android Studio. In which I have Firebase Authorization implemented and that is working absolutely fine. I am able to push documents to Firestore Database.

But now, I am trying to add functionality using which I can store media/images to Firebase Storage but when I am adding this dependency to app’s build.gradle file, I am getting this error:

Dependency added:

implementation 'com.google.firebase:firebase-storage:16.0.1'

This is the error that I am getting:

Could not find firebase-common.jar (com.google.firebase:firebase-common:16.0.0).
Searched in the following locations:https://jcenter.bintray.com/com/google/firebase/firebase-common/16.0.0/firebase-common-16.0.0.jar

FYI, In my project I already have this kind of configuration:

classpath 'com.android.tools.build:gradle:3.1.3'

And

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

I can not find what is going wrong when I just add firebase-storage dependency to my Android project.

Here is my app level build.gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "com.firebase.example"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}

dependencies {
implementation 'com.google.firebase:firebase-firestore:16.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'

implementation 'com.google.android.gms:play-services-auth:15.0.1'

implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:23.2.1'
implementation 'com.android.support:design:23.2.1'
implementation 'com.android.support:recyclerview-v7:23.2.1'
}
apply plugin: 'com.google.gms.google-services'

Here is my module level build.gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
classpath 'com.google.android.gms:play-services-base:15.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
}
}

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

5 Answers
5

Have you added these to your root level gradle file?

buildscript {

dependencies {

classpath 'com.google.gms:google-services:4.0.1'
}
}

allprojects {

repositories {

google()
}
}

You have to add dependencies {classpath 'com.google.gms:google-services:4.0.1'} and repositories { google()} on your root level build.gradle file. Have you added that? And further more please provide your whole build.gradle file in order to understand your problem .

dependencies {classpath 'com.google.gms:google-services:4.0.1'}

repositories { google()}

implementation 'com.google.firebase:firebase-firestore:16.0.0' implementation 'com.google.firebase:firebase-auth:15.1.0' implementation 'com.google.firebase:firebase-storage:16.0.1' implementation 'com.google.android.gms:play-services-auth:15.0.1'

classpath 'com.google.android.gms:play-services-base:15.0.1' classpath 'com.google.gms:google-services:4.0.1'

Upgrade the following:

implementation 'com.google.firebase:firebase-firestore:16.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'

into this:

implementation 'com.google.firebase:firebase-firestore:17.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.2'

Check here for more info:

https://firebase.google.com/support/release-notes/android

implementation 'com.google.firebase:firebase-database:16.0.1'

Also you can use firebase assitant set up

enter image description here

I was able to make it work guys. You can simply compare my new gradle files. The issue was conflicting google services libraries and gradle version. So, I created new project and just added dependencies again like this and it worked.

So, I removed this from app/build.gradle:

implementation 'com.google.android.gms:play-services-auth:15.0.1'

And, removed this from module/build.gradle:

classpath 'com.google.android.gms:play-services-base:15.0.1'

and updated gradle version in module/build.gradle:

classpath 'com.google.gms:google-services:4.0.1'

New build.gradle files look like this.

module/build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin

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

allprojects {
repositories {
google()
jcenter()
}
}

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

app/build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "master.firebasesetup"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
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.google.firebase:firebase-firestore:17.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'

By clicking “Post Your Answer», you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Понравилась статья? Поделить с друзьями:
  • Error could not read auth username password ok string from management interface
  • Error could not read a hi value
  • Error could not process rule no such file or directory nft
  • Error could not parse gisl program
  • Error could not open requirements file errno 2 no such file or directory requirements txt