Error could not resolve all firebase dependencies unavailablelnvalid ok

[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

Понравилась статья? Поделить с друзьями:
  • Error could not resolve all firebase dependencies unavailable invalid
  • Error could not request certificate getaddrinfo name or service not known
  • 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