Skip to content

[BUG] JNI exceptions in console when having a lot of rebuilds or controller calls at once #136

@josxha

Description

@josxha

Platforms

Android

Version of flutter-maplibre

0.1.2

Bug Description

When rebuilding the MapLibreMap widget a lot in a short amount of times the console shows JNI related exceptions.

E/flutter (26853): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Use after release error
E/flutter (26853): #0      JReference.pointer (package:jni/src/jreference.dart:56:21)
E/flutter (26853): #1      MapLibreMap.moveCamera (package:maplibre/src/native/jni/org/maplibre/android/maps/MapLibreMap.dart:5280:27)
E/flutter (26853): #2      MapLibreMapStateJni.moveCamera.<anonymous closure> (package:maplibre/src/native/widget_state_jni.dart:221:14)
E/flutter (26853): #3      _platformIsolateMain.<anonymous closure> (dart:ui/platform_isolate.dart:142:51)
E/flutter (26853): #4      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
E/flutter (26853): 

When hot restarting the app, another exception gets logged in the console:

E/flutter (26880): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformIsolate shutdown unexpectedly

Steps to Reproduce

Using the MapLibreLayer in flutter_map_maplibre, see bug report here: josxha/flutter_map_plugins#54

Expected Results

Don't throw any exceptions

Actual Results

Exceptions in the console and future calls are partly unresponsive.

Code Sample

// Paste your code here

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidAndroid specific issuebugSomething isn't working

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions