react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

app crash on BackgroundGeolocation.start()

Open abbas321 opened this issue 5 years ago • 14 comments

Your Environment

  • Plugin version:
  • Platform: iOS or Android
  • OS version:
  • Device manufacturer and model:
  • Running in Simulator:
  • React Native version:
  • Plugin configuration options:
  • Link to your project:

Context

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

Context

Debug logs

abbas321 avatar Jan 08 '20 10:01 abbas321

Same here, with no error displayed anywhere. Just crashing.

dragma avatar Feb 22 '20 14:02 dragma

having thesame problem here. when I comment out "BackgroundGeolocation.start()", the app builds well without crashing but when I make the method active, the app crashes. Anyone found a working solution?

adujoseph avatar Feb 25 '20 20:02 adujoseph

Seems like the crash stoped when I removed the package react-native-permissions, but I'm not 100% sure.

dragma avatar Feb 26 '20 15:02 dragma

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

kabhimanyu avatar Mar 13 '20 03:03 kabhimanyu

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

this worked for me, thanks @kabhimanyu

natanfernandes avatar Mar 24 '20 14:03 natanfernandes

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

Thank you, brother. You saved my life.

Robiullah2244 avatar Jul 27 '20 06:07 Robiullah2244

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

This does not resolve my issue. any other resolve which might help

hunzalashakeel1996 avatar Oct 15 '20 10:10 hunzalashakeel1996

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

Thank you

kitravee avatar Nov 06 '20 20:11 kitravee

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

Want say thanks for that comment. and I also want add some notes for that issue. After adding that 2 lines i received next error.

"didn't find class androidx.localbroadcastmanager.content.localbroadcastmanager on path ...."

Few hours of research on internet and I found additional 2 implementation which help fix that issue:

implementation "androidx.legacy:legacy-support-v4:1.0.0" implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0" ----UPD ---- "react": "16.13.1", "react-native": "0.63.2", "@mauron85/react-native-background-geolocation": "0.6.3",

IhorReactNative avatar Jan 27 '21 21:01 IhorReactNative

@IhorReactNative I'm using the same lib versions as yours, but it keep crashing on my device. In the simulator is working fine though.

ziin avatar Jan 29 '21 05:01 ziin

Facing an app crash also when BackgroundGeolocation.start() is called. I added all four dependencies and facing the same issue implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1 implementation "androidx.legacy:legacy-support-v4:1.0.0" implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"

"react": "16.9.0", "react-native": "0.61.2", "@mauron85/react-native-background-geolocation": "^0.6.3",

MufaddalApps avatar Feb 21 '21 14:02 MufaddalApps

I was able to fix this issue by just adding implementation "androidx.legacy:legacy-support-v4:1.0.0" into the dependency list

sergeylaptev avatar Apr 07 '21 14:04 sergeylaptev

I was able to fix this issue by just adding implementation "androidx.legacy:legacy-support-v4:1.0.0" into the dependency list

Can you please share the contents of your build.gradle ?

Balthazar33 avatar May 06 '21 05:05 Balthazar33

So After debugging the issue I found adding these two things to your. android/app/build.gradle solves the issues implementation com.google.android.gms:play-services-gcm:15.0.1 implementation com.google.android.gms:play-services-location:15.0.1

u save my life

NeverGone97 avatar Nov 08 '22 02:11 NeverGone97