You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PlatformException(STYLE IS NULL, The style is null. Has onStyleLoaded() already been invoked?, null) #384
getting this error in released app Which causes symbols not to appear
on android real device
Flutter 1.21.0-7.0.pre • channel dev
package version 0.7.0
Non-fatal Exception: java.lang.Exception
PlatformException(STYLE IS NULL, The style is null. Has onStyleLoaded() already been invoked?, null)
@hussenIbrahim Does this error occur when you add images? If yes, when do you add the images?
i don't know where or when it occurs and this error not every time thrown
i get the error from firebase Crashlytics
` void _onMapCreated(MapboxMapController controller) {
print("map created");
mapController = controller;
addImageFromAsset();
mapController.onSymbolTapped.add((argument) {
_onSymbolTapped(argument);
print(mapController.symbols.length);
});
}
I/flutter ( 7556): RangeError (index): Invalid value: Only valid value is 0: 1 E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): Failed to handle method call E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(MapboxMapController.java:740) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.Looper.loop(Looper.java:136) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) E/DartMessenger( 7556): Uncaught exception in binary message listener E/DartMessenger( 7556): java.lang.IllegalStateException: Reply already submitted E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139) E/DartMessenger( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:246) E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/DartMessenger( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/DartMessenger( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/DartMessenger( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/DartMessenger( 7556): at android.os.Looper.loop(Looper.java:136) E/DartMessenger( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/DartMessenger( 7556): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) I/flutter ( 7556): Error caught by Crashlytics plugin <recordError>: I/flutter ( 7556): RangeError (index): Invalid value: Only valid value is 0: 1 E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): Failed to handle method call E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(MapboxMapController.java:740) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.Looper.loop(Looper.java:136) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) E/DartMessenger( 7556): Uncaught exception in binary message listener E/DartMessenger( 7556): java.lang.IllegalStateException: Reply already submitted E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139) E/DartMessenger( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:246) E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/DartMessenger( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/DartMessenger( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/DartMessenger( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/DartMessenger( 7556): at android.os.Looper.loop(Looper.java:136) E/DartMessenger( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/DartMessenger( 7556): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
@hussenIbrahim As noted in the documentation, please only call addImage() after onStyleLoaded callback has been invoked. Otherwise you might get this error, as images are added to a style, which isn't possible when the style hasn't been completely loaded, yet.
the error is solved for release and profile mode
but in debug mode on onStyleLoaded callback its invoked once when app is installed else it is not invoked until uninstall the app or clear the app cache
thanks @m0nac0
@hussenIbrahim Interesting, that sounds similar to what has been described in #347 (but only for iOS so far). Unfortunately I haven't been able to reproduce that, yet, but I'll look out for it if you also experience this on Android.
Activity
m0nac0 commentedon Aug 16, 2020
@hussenIbrahim Does this error occur when you add images? If yes, when do you add the images?
hussenIbrahim commentedon Aug 16, 2020
i don't know where or when it occurs and this error not every time thrown
i get the error from firebase Crashlytics
` void _onMapCreated(MapboxMapController controller) {
print("map created");
mapController = controller;
addImageFromAsset();
mapController.onSymbolTapped.add((argument) {
_onSymbolTapped(argument);
print(mapController.symbols.length);
});
}
Future addImageFromAsset() async {
ByteData bytes = await rootBundle.load("assets/icon.png");
Uint8List list = bytes.buffer.asUint8List();
mapController.addImage("icon", list);
}`
hussenIbrahim commentedon Aug 16, 2020
getting this error in profile mode
I/flutter ( 7556): RangeError (index): Invalid value: Only valid value is 0: 1 E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): Failed to handle method call E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(MapboxMapController.java:740) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.Looper.loop(Looper.java:136) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) E/DartMessenger( 7556): Uncaught exception in binary message listener E/DartMessenger( 7556): java.lang.IllegalStateException: Reply already submitted E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139) E/DartMessenger( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:246) E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/DartMessenger( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/DartMessenger( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/DartMessenger( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/DartMessenger( 7556): at android.os.Looper.loop(Looper.java:136) E/DartMessenger( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/DartMessenger( 7556): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) I/flutter ( 7556): Error caught by Crashlytics plugin <recordError>: I/flutter ( 7556): RangeError (index): Invalid value: Only valid value is 0: 1 E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): Failed to handle method call E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): java.lang.NullPointerException: Attempt to invoke a virtual method on a null object reference E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(MapboxMapController.java:740) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.os.Looper.loop(Looper.java:136) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/MethodChannel#plugins.flutter.io/mapbox_maps_0( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) E/DartMessenger( 7556): Uncaught exception in binary message listener E/DartMessenger( 7556): java.lang.IllegalStateException: Reply already submitted E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139) E/DartMessenger( 7556): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:246) E/DartMessenger( 7556): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/DartMessenger( 7556): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/DartMessenger( 7556): at android.os.MessageQueue.nativePollOnce(Native Method) E/DartMessenger( 7556): at android.os.MessageQueue.next(MessageQueue.java:323) E/DartMessenger( 7556): at android.os.Looper.loop(Looper.java:136) E/DartMessenger( 7556): at android.app.ActivityThread.main(ActivityThread.java:6776) E/DartMessenger( 7556): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) E/DartMessenger( 7556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)m0nac0 commentedon Aug 17, 2020
@hussenIbrahim As noted in the documentation, please only call addImage() after onStyleLoaded callback has been invoked. Otherwise you might get this error, as images are added to a style, which isn't possible when the style hasn't been completely loaded, yet.
hussenIbrahim commentedon Aug 17, 2020
the error is solved for release and profile mode
but in debug mode on onStyleLoaded callback its invoked once when app is installed else it is not invoked until uninstall the app or clear the app cache
thanks @m0nac0
m0nac0 commentedon Aug 17, 2020
@hussenIbrahim Interesting, that sounds similar to what has been described in #347 (but only for iOS so far). Unfortunately I haven't been able to reproduce that, yet, but I'll look out for it if you also experience this on Android.