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) - App crashes when clicking on Map's "Update" button to update Google Services #618

Closed
39otrebla opened this issue Sep 27, 2016 · 9 comments

Comments

@39otrebla
Copy link

39otrebla commented Sep 27, 2016

As the title states, running on a device with an old version of Google Services (for instance I am running a phone with Google Play services 8703470 while RN-maps requires 9452000), the Map correctly shows an "Update" button, but clicking on it results in a crash.

Relevant log's lines:
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

RN@0.33 , RN-maps@0.8.2, tested on Android M and Android 5

@saberking
Copy link
Contributor

I also have this problem

@moaxaca
Copy link

moaxaca commented Oct 4, 2016

Me as well

Android - Samsung Galaxy S4 - API 19 (Physical Device)

@luisfuertes
Copy link

luisfuertes commented Oct 19, 2016

+1. When device dont have the Google Services installed and you press on "Update" or any part of map view, app crash

At the moment i "fix" it, checking the Android play services with Google singing component:

        GoogleSignin.hasPlayServices({ autoResolve: false }).then(() => {
            console.log("Play services all ok");
        })
        .catch((err) => {
            console.log("Play services error", err.code, err.message);
        })

And if catch is called, i dont show the maps in app.

@brianinator
Copy link

brianinator commented Dec 19, 2016

Me as well

react-native-maps: 0.12.2
react-native: 0.36.0
Device: Samsung S4
Android: 5.0.1

Update
So I downloaded the Google Play Services app off the Google Play Store on the target device. And then rerun the app the map view appears correctly and no longer is there a prompt to update Google Play Services. Not a solution to the issue but maybe helpful to kick this issue down the road a bit.

@mitchward
Copy link

We are getting this issue too - The map not working isn't a huge issue if Google Play Services needs updating, but having the whole app crash is an issue.

If it helps, I have a crash report:
AirMapView.java ​ Line 611 - AirMapView$11.run
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.Projection com.google.android.gms.maps.GoogleMap.getProjection()' on a null object reference

@caricbrown
Copy link

MapView must be inflated from an actual "Activity" context so that the Intent called by the "Update" button will know where to start.

Just a guess but, AirMapView.java takes an appContext that uses .getCurrentActivity() which may not be resolving to an activity?

@IgorVanian
Copy link

Exactly the same error as @mitchward .
The device is using 8.7.03 and RNMaps needs 9.8.0. There should be a way to ask the user to update his google services before using the app...

@mattshen
Copy link
Contributor

This seems to be triggered when user touched the blank area around the "Update" button.

@mattshen
Copy link
Contributor

I created a PR to fix this issue, any comments are welcome.

#1443

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

10 participants