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

Android - showUserLocation strange crash #1093

Closed
stephenheron opened this issue Mar 5, 2018 · 5 comments
Closed

Android - showUserLocation strange crash #1093

stephenheron opened this issue Mar 5, 2018 · 5 comments

Comments

@stephenheron
Copy link

Hi,

Having quite a strange issue, I am toggling the showUserLocation prop and it works perfectly fine in iOS. When it's toggled on in Android I get the "Application has stopped" working popup however the app seems to continue functioning but the users location does not appear. After the popup appears it never seems to reappear until I close the app and open it again. The user's location is never displayed. I am using the latest version (6.1.0).

Annoyingly I can't see anything in Logcat which is making debugging this issue very difficult. I have never seen an app crash like that before where the popup shows up but the app still continues to work.

Anyone seen this before? I have attached a gif showing the issue as I know it's quite difficult to explain.
The map moving is my code so it's still running and appearing to be moving the map to the user's correct location.

ezgif-5-bc41832746

Thanks,
Stephen

@nitaliano
Copy link
Owner

@stephenheron I'll take a look at it thanks for reporting!

@stephenheron
Copy link
Author

Hi @nitaliano

Think this is my problem actually.

Just investigating further now.

Thanks,
Stephen

@stephenheron
Copy link
Author

Yup was my problem.

Strange one to be honest I had another look at Logcat and found this message:

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process

I am using Firebase on react using this libarary(https://github.com/invertase/react-native-firebase). Initially I thought the message was incorrect as the app seems to work correctly and connect to Firebase and according to the documentation it should be initialised automatically.

However when I add "FirebaseApp.initializeApp(this);" to the onCreate method in MainApplication the error goes away. I need to make sure it does not cause any other problems but for the moment it seems to be fixed.

Very interesting it seems that setting showUserLocation to true creates another process. I had a look in Android Device Monitor and before clicking the location button the process list looks like this:

before

and after

after

Interesting little issue.

@nitaliano
Copy link
Owner

Yes, it's firing up the lost location engine when we show the user location. I'm also using react-native-firebase in another project here and it's been a pleasure to work with so far once you get all of the configuration stuff out of the way.

Can this be closed?

@stephenheron
Copy link
Author

Ahhh ok cheers for clarifying I was going to start digging as it was bugging me.

Yup react-native-firebase is ace this is the first odd problem I have had with it.

Feel free to close!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants