question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashing on Android

See original GitHub issue

Summary

Version 0.21.5
Affected OS Android
OS Version ?

Current behavior

The app is crashing after linking the library. Here are some screenshots of my code

settings.gradle image

android/build.gradle image

android/app/build.gradle image image

Expected behavior

To work without any errors.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23

github_iconTop GitHub Comments

3reactions
bastolaxantoscommented, Jun 7, 2018

@sircEUNHO If you still facing crash problem then follow these steps. It worked in my case:

  1. Open the project on Android Studio

  2. On app level build.gradle file use same version on all firebase and gms dependencies. dependencies { compile project(‘:react-native-device-info’) compile project(‘:react-native-fcm’) compile fileTree(dir: “libs”, include: [“*.jar”]) compile “com.android.support:appcompat-v7:23.0.1” compile “com.facebook.react:react-native:+” compile ‘com.google.firebase:firebase-core:10.0.1’ compile ‘com.google.firebase:firebase-messaging:10.0.1’ }

  3. Open build.gradle file of react-native-device-info module

  4. Put the same version of dependency on play-services-gcm dependencies { def googlePlayServicesVersion = project.hasProperty(‘googlePlayServicesVersion’) ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION

    compile ‘com.facebook.react:react-native:+’ compile “com.google.android.gms:play-services-gcm:10.0.1” }

  5. Open build.gradle of firebase module you installed. In my case it is react-native-fcm

  6. Repeat the same process (use same version for all firebase dependencies) dependencies { def googlePlayServicesVersion = project.hasProperty(‘googlePlayServicesVersion’) ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION

    compile fileTree(include: [‘*.jar’], dir: ‘libs’) compile ‘com.facebook.react:react-native:+’ compile “com.google.firebase:firebase-core:10.0.1” compile “com.google.firebase:firebase-messaging:10.0.1” compile ‘me.leolin:ShortcutBadger:1.1.17@aar’ }

  7. Sync the gradle file and build the project

2reactions
babarbahadurcommented, Mar 20, 2020

I was also having the same issue and i simply commented these 3 lines in node_modules/react-native-device-info/android/build.gradle… It works for me!!! Note: I wasn’t using firebase, I was only using react-native-maps & geolocation-location library. Please make sure you have manually linked the library

if(firebaseIidVersion){ // implementation “com.google.firebase:firebase-iid:$firebaseIidVersion” }else{ // def iidVersion = safeExtGet(‘googlePlayServicesIidVersion’, safeExtGet(‘googlePlayServicesVersion’, ‘17.0.0’)) // implementation “com.google.android.gms:play-services-iid:$iidVersion” }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Do My Apps Keep Crashing on Android?
Why Do My Apps Keep Crashing on Android? · 1. The “Force stop” method · 2. Restart your Android device · 3. Keep...
Read more >
Apps keep crashing on Android? Here's what to do
How to stop apps from crashing · Check your internet connection · Check your phone storage · Restart the phone · Force stop...
Read more >
Fix an Android device that's restarting or crashing
Restart your phone. One by one, remove recently downloaded apps. Learn how to delete apps. After each removal, restart your phone normally. See...
Read more >
Crashes
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
8 Ways to Fix Android Apps Crashing
8 Ways to Fix Android Apps Crashing · 1. Check the Internet Connection · 2. Restart the Crashing App · 3. Restart Your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found