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

Platform crash on android at startup #577

Closed
vanlooverenkoen opened this issue Mar 22, 2021 · 4 comments
Closed

Platform crash on android at startup #577

vanlooverenkoen opened this issue Mar 22, 2021 · 4 comments

Comments

@vanlooverenkoen
Copy link

vanlooverenkoen commented Mar 22, 2021

I am having a crash when the mapbox map should be loaded.

This is my code. I am not doing anything with the controller. that is all commended out.

We are still using v1 embedding because of breaking packages in our project & to close to the release to migrate everything

         MapboxMap(
            onStyleLoadedCallback: () {},
            styleString: 'mapbox://styles/...',
            accessToken: '...',
            initialCameraPosition: const CameraPosition(
              target: LatLng(
                AppConstants.DEFAULT_LAT,
                AppConstants.DEFAULT_LON,
              ),
              zoom: _DEFAULT_ZOOM,
            ),
            onMapCreated: _onMapCreated,
          ),

The crash:

2021-03-22 09:53:05.786 27370-27370/? E/Mbgl-MapChangeReceiver: Exception in onStyleImageMissing
    java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String io.flutter.embedding.engine.plugins.FlutterPlugin$FlutterAssets.getAssetFilePathByName(java.lang.String)' on a null object reference
        at com.mapbox.mapboxgl.MapboxMapController.getScaledImage(MapboxMapController.java:1291)
        at com.mapbox.mapboxgl.MapboxMapController.lambda$onMapReady$0$MapboxMapController(MapboxMapController.java:260)
        at com.mapbox.mapboxgl.-$$Lambda$MapboxMapController$ycG5vS2dYfqOKlQHaQNF87a0YOg.onStyleImageMissing(Unknown Source:4)
        at com.mapbox.mapboxsdk.maps.MapChangeReceiver.onStyleImageMissing(MapChangeReceiver.java:226)
        at com.mapbox.mapboxsdk.maps.NativeMapView.onStyleImageMissing(NativeMapView.java:1120)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:335)
        at android.os.Looper.loop(Looper.java:183)
        at android.app.ActivityThread.main(ActivityThread.java:7660)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
@vanlooverenkoen
Copy link
Author

v0.9.0 is working fine
#183 is implemented in #488
But with it v1 backwards compatibility was removed. I think the plugin is never attached in v1 embedding on android.

@vanlooverenkoen
Copy link
Author

The only reason why I need v0.10.0 is because of
#443
#512

I forked the repo to add the fix to the 0.9.0 branch -> https://github.com/icapps/flutter-mapbox-gl/tree/bugfix/0.9.0-ios-tap-line

@shroff
Copy link
Collaborator

shroff commented Apr 12, 2021

Is this issue still occurring with the latest release v0.11.0?

@m0nac0
Copy link
Collaborator

m0nac0 commented Oct 31, 2021

Closing since the issue is stale / without response.

@m0nac0 m0nac0 closed this as completed Oct 31, 2021
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

3 participants