Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/platforminfo/LibraryVersionComponent . #2047

Closed
saddamandroid opened this issue Apr 10, 2019 · 23 comments

Comments

@saddamandroid
Copy link

"react-native": "0.58.3"
"react-native-firebase": "^5.3.0",

2019-04-10 15:51:26.815 15692-15692/com.gulpandgobble E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gulpandgobble, PID: 15692
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/platforminfo/LibraryVersionComponent;
at io.invertase.firebase.ReactNativeFirebaseAppRegistrar.getComponents(ReactNativeFirebaseAppRegistrar.java:34)
at com.google.firebase.components.zzf.(com.google.firebase:firebase-common@@16.0.2:52)
at com.google.firebase.FirebaseApp.(com.google.firebase:firebase-common@@16.0.2:539)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:355)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:324)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:310)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.0.2:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.0.2:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.platforminfo.LibraryVersionComponent" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.gulpandgobble-Mxgc3BtcBerRx29FmX2FeQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.gulpandgobble-Mxgc3BtcBerRx29FmX2FeQ==/lib/x86, /data/app/com.gulpandgobble-Mxgc3BtcBerRx29FmX2FeQ==/base.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

@jpm8888
Copy link

jpm8888 commented Apr 10, 2019

"react-native-firebase": "^5.3.0",

I also have same error.

"react-native-firebase": "5.2.5", use this version for the mean time, it is working fine.

@Salakar
Copy link
Member

Salakar commented Apr 10, 2019

Hey 👋 thanks for the report - please can you try version 5.3.1 - I've just pushed this up which should fix this issue.

@Salakar Salakar closed this as completed Apr 10, 2019
@brenwell
Copy link

Fixed it for me !

@badrey
Copy link

badrey commented Jun 18, 2019

Have the same error for:
"react-native-firebase": "5.4.0"

Any suggestion please why it can be?

@mikehardy
Copy link
Collaborator

@murilobast
Copy link

Having the same issue with 5.5.5, can't switch version sinse it's the only one working with 0.60.x
Any ideia of what is causing this?

@Sheleya
Copy link

Sheleya commented Jul 12, 2019

Same issue with 5.5.5 version and react-native 0.59.5
And if I downgrade version of firebase, then I receive an error on iOS side, such as
"FirebaseCore/FIRAnalyticsConfiguration.h file not found"
//UPDATED
I fixed this issue by downgrading to 5.3.1 (android works well), and specifying for iOS, pod
"pod 'Firebase/Core', '~> 5.20.1'". That fixed it for me

@alexciarlillo
Copy link

Having this issue as well on 5.5.5 with RN 0.60.3. Only trying to build for Android right now. Using Play Services 16.1.0

@mikehardy
Copy link
Collaborator

Out of curiosity, you have moved to the AndroidX react-native, and the react-native-firebase that introduced a breaking change essentially just to support the APIs in the AndroidX Google SDKs, but have not moved the AndroidX Google SDKs? Have you tried it with the most recent (AndroidX) google SDKs?

@alexciarlillo
Copy link

Yeah we are still kind of working our way through the upgrade and dealing with some build process issues and other packages. However, I did get RNFirebase working by setting the following firebase deps:

    implementation "com.google.firebase:firebase-core:17.0.1"
    implementation "com.google.firebase:firebase-messaging:19.0.1"

Still using

implementation "com.google.android.gms:play-services-base:16.1.0"

@littlehome-eugene
Copy link

Same issue with 5.5.5 version and react-native 0.59.4

@mikehardy
Copy link
Collaborator

I dunno - I have not been able to reproduce this, but I use current versions pretty much all the time: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

@empy92
Copy link

empy92 commented Jul 29, 2019

Same issue with 5.5.5 version and react-native 0.59.5
And if I downgrade version of firebase, then I receive an error on iOS side, such as
"FirebaseCore/FIRAnalyticsConfiguration.h file not found"
//UPDATED
I fixed this issue by downgrading to 5.3.1 (android works well), and specifying for iOS, pod
"pod 'Firebase/Core', '~> 5.20.1'". That fixed it for me

the same worked for me

@varunon9
Copy link

varunon9 commented Aug 4, 2019

I upgraded firebase-messaging to 18.0.0 to get it work.
Complete configuration-
googlePlayServicesVersion = "16.0.0" in /project/android/build.gradle

/project/android/app/build.gradle-

    implementation "com.google.android.gms:play-services-tagmanager:16.0.4"

    implementation "com.google.firebase:firebase-messaging:18.0.0"
    implementation "com.google.firebase:firebase-core:16.0.4"
    implementation "com.google.firebase:firebase-config:16.1.0"

    implementation "com.google.android.gms:play-services-base:${playServiceVersion}"
    implementation "com.google.android.gms:play-services-maps:${playServiceVersion}"
    implementation "com.google.android.gms:play-services-places:${playServiceVersion}"
    implementation "com.google.android.gms:play-services-location:${playServiceVersion}"

@yannickoo
Copy link

Downgrading to 5.3.1 fixed it for me 💪

@mehrankhandev
Copy link

"react-native-firebase": "5.5.4"

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation "com.google.firebase:firebase-messaging:18.0.0"

Fix issue for me

@mikehardy
Copy link
Collaborator

mikehardy commented Aug 27, 2019

[edited out - I think I just totally misunderstand the previous comment]

@mickmaccallum
Copy link

@mikehardy I believe he meant "Fixes the issue for me."

@mikehardy
Copy link
Collaborator

haha that would make a lot more sense! :-) - I'll edit my answer, I understand langauge difficulties as a person living away from my birth country. Cheers

@jnrana
Copy link

jnrana commented Sep 2, 2019

"react-native-firebase": "5.5.4"

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation "com.google.firebase:firebase-messaging:18.0.0"

Fix issue for me

After spending half a day on this.
^ this fixed for me. Thanks mate.

implementation "com.google.android.gms:play-services-base:15.0.1"
    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.firebase:firebase-messaging:18.0.0"

@mikehardy
Copy link
Collaborator

Is there some defect in the supported versions table that is leading to this error? https://rnfirebase.io/docs/v5.x.x/getting-started#Supported-versions---React-Native-/-Firebase

@FakeBounce
Copy link

How does it come that we have so many issues with your module ? I spent more than a week this year debugging this module and you still can't provide a working version after 2years of development... that's frustating to debug a module which is supposed to work (this is clearly not a beta module) everytime i update something.

@MehranTheDeveloper fix did it for me :
"react-native-firebase": "5.5.4"

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation "com.google.firebase:firebase-messaging:18.0.0"

but i had to update :
implementation('com.google.android.gms:play-services-base:15.0.0')
to
implementation('com.google.android.gms:play-services-basement:16.2.0')

@mikehardy
Copy link
Collaborator

How does it come that this module just works for me? I spent just a week this year integrating this module and had a working version despite less than a month using react-native...that's amazing because I almost didn't know what I was doing (this is clearly a well-tested module) and more bugs are fixed every time I update

There, I fixed that for ya

@FakeBounce you're still behind on versions. In general staying current with everything is useful.

@invertase invertase locked as resolved and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests