Firebase Config: ClassNotFoundException - PullRequest
       14

Firebase Config: ClassNotFoundException

1 голос
/ 02 апреля 2020

Я вижу следующую ошибку после добавления RemoteConfig.

2020-04-02 16:47:06.844 12100-12100/removed W/ComponentDiscovery: Class com.google.firebase.remoteconfig.ktx.FirebaseConfigKtxRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.remoteconfig.ktx.FirebaseConfigKtxRegistrar
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:453)
    at java.lang.Class.forName(Class.java:378)
    at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80)
    at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73)
    at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@19.3.0:404)
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:300)
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:268)
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:253)
    at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@19.3.0:51)
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1927)
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1902)
    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@19.3.0:45)
    at android.app.ActivityThread.installProvider(ActivityThread.java:6528)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:6021)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5927)
    at android.app.ActivityThread.access$1200(ActivityThread.java:200)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:201)
    at android.app.ActivityThread.main(ActivityThread.java:6806)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.remoteconfig.ktx.FirebaseConfigKtxRegistrar" on path: DexPathList[[zip file "/data/app/removed-VBiXJeGazGh2qyHGB8IDBA==/base.apk"],nativeLibraryDirectories=[/data/app/removed-VBiXJeGazGh2qyHGB8IDBA==/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at java.lang.Class.classForName(Native Method) 
    at java.lang.Class.forName(Class.java:453) 
    at java.lang.Class.forName(Class.java:378) 
    at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-components@@16.0.0:80) 
    at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-components@@16.0.0:73) 
    at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@19.3.0:404) 
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:300) 
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:268) 
    at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.3.0:253) 
    at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@19.3.0:51) 
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1927) 
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1902) 
    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@19.3.0:45) 
    at android.app.ActivityThread.installProvider(ActivityThread.java:6528) 
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:6021) 
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5927) 
    at android.app.ActivityThread.access$1200(ActivityThread.java:200) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loop(Looper.java:201) 
    at android.app.ActivityThread.main(ActivityThread.java:6806) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 

Зависимости Gradle

def room_version = "2.2.4"
api 'com.google.android.material:material:1.2.0-alpha05'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.2.1'
implementation 'androidx.navigation:navigation-ui:2.2.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'com.google.firebase:firebase-messaging:20.1.3'
implementation 'com.google.firebase:firebase-core:17.2.3'
implementation 'com.google.firebase:firebase-firestore-ktx:21.4.1'
implementation 'com.google.firebase:firebase-auth:19.3.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.json:json:20140107'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.squareup.okhttp3:okhttp:4.3.1'
implementation "org.jetbrains.anko:anko:$anko_version"
implementation 'com.auth0.android:jwtdecode:1.4.0'
implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:4.1.2'
implementation 'com.sothree.slidinguppanel:library:3.4.0'
implementation 'com.google.android:flexbox:2.0.1'
implementation 'joda-time:joda-time:2.10.5'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'info.androidhive:fontawesome:0.0.5'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.4.0'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.razorpay:checkout:1.5.13'
implementation "com.airbnb.android:lottie:$lottieVersion"
implementation 'com.github.AppIntro:AppIntro:5.1.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4"
// Recommended: Add the FireBase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:17.2.3'
// Add the Firebase SDK for Crashlytics.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta02'
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// For Kotlin use kapt instead of annotationProcessor
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
implementation 'com.github.GrenderG:Toasty:1.4.2'
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
implementation 'com.google.firebase:firebase-storage-ktx:19.1.1'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'id.zelory:compressor:3.0.0'
implementation 'com.google.firebase:firebase-appindexing:19.1.0'
implementation 'com.google.firebase:firebase-config-ktx:19.1.3'

Syn c удаленная конфигурация

 private fun initRemoteConfig(){
    val configSettings = remoteConfigSettings {
        minimumFetchIntervalInSeconds = 3600//3
    }
    remoteConfig.setConfigSettingsAsync(configSettings)
    remoteConfig.setDefaultsAsync(R.xml.remote_config_defaults)
    remoteConfig.fetchAndActivate()
}

У меня есть локальная копия конфигурации Firebase. Все работает нормально. Я просто вижу ошибку в консоли.

1 Ответ

0 голосов
/ 06 апреля 2020

У меня такая же проблема. К счастью, в конвейере уже есть исправление: https://github.com/firebase/firebase-android-sdk/pull/1209 ... к сожалению, оно все еще открыто. С 6 февраля: - /

Редактировать: понял, что эта ошибка не является проблемой. Удаленный конфиг все еще работает

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