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

NPE onMapInitialized #115

Open
leonardo2204 opened this issue Nov 24, 2017 · 0 comments
Open

NPE onMapInitialized #115

leonardo2204 opened this issue Nov 24, 2017 · 0 comments

Comments

@leonardo2204
Copy link
Contributor

Starting at version 1.5.0, we've seen a weird NPE crash in your app:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.airbnb.android.airmapview.AirMapInterface com.airbnb.android.airmapview.AirMapView.getMapInterface()' on a null object reference
       at br.com.moobie.android.carMaps.CarMapFragment.onMapInitialized(CarMapFragment.java:308)
       at com.airbnb.android.airmapview.AirMapView.onMapLoaded(AirMapView.java:416)
       at com.airbnb.android.airmapview.NativeGoogleMapFragment$1.onMapReady(NativeGoogleMapFragment.java:78)
       at com.google.android.gms.maps.zzaj.zza(Unknown Source)
       at com.google.android.gms.maps.internal.zzaq.onTransact(Unknown Source)
       at android.os.Binder.transact(Binder.java:387)
       at fv.b(:com.google.android.gms.DynamiteModulesB@11745436:20)
       at com.google.android.gms.maps.internal.bf.a(:com.google.android.gms.DynamiteModulesB@11745436:5)
       at com.google.maps.api.android.lib6.impl.bc.run(:com.google.android.gms.DynamiteModulesB@11745436:5)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7325)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I've tried to reproduce the error but I couldn't so far.
In the latter version (1.4.0) everything was working properly, I'm suspecting it might be related with the Google Play Services bump #98, but I'm not sure.

My onMapInitialized:

 @Override
    public void onMapInitialized() {
        map.getMapInterface().setMapToolbarEnabled(false);
        ....
}
 @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        map.setOnCameraChangeListener(this);
        map.setOnMarkerClickListener(this);
        map.setOnMapInitializedListener(this);
        map.initialize(getChildFragmentManager());
    }

Is there anyone else facing this issue?

Thanks!

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

1 participant