Crashing on Android
See original GitHub issueSummary
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
android/build.gradle
android/app/build.gradle
Expected behavior
To work without any errors.
Issue Analytics
- State:
- Created 5 years ago
- Comments:23
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sircEUNHO If you still facing crash problem then follow these steps. It worked in my case:
Open the project on Android Studio
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’ }
Open build.gradle file of react-native-device-info module
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” }
Open build.gradle of firebase module you installed. In my case it is react-native-fcm
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’ }
Sync the gradle file and build the project
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” }