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
В приложении реализована фоновая обработка событий как описано в Background processes и в ходе которой создается отдельный FlutterEngine и потом, после обработки события. уничтожается. Проблема в том, что при этом возникает крэш
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void x6.k.e(x6.k$c)' on a null object reference
at com.unact.yandexmapkit.full.InitFull.teardownChannels(InitFull.java:1)
at com.unact.yandexmapkit.full.InitFull.onDetachedFromEngine(InitFull.java:1)
at com.unact.yandexmapkit.YandexMapkitPlugin.onDetachedFromEngine(YandexMapkitPlugin.java:3)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:1)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:1)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:1)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:1)
at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:1)
Приложение собрано Flutter 3.19.6
The text was updated successfully, but these errors were encountered:
Проблема возникла после обновления с версии 4.0.2 на 4.1.0 и, похоже, из-за того, что YandexMapkitPlugin теперь реализован через синглтон BuildConfig.YANDEX_MAPKIT_INIT, а раньше внутри плагина создавался отдельный инстанс variantInit, было
public class YandexMapkitPlugin implements FlutterPlugin, ActivityAware {
private final Init variantInit;
public YandexMapkitPlugin() throws IllegalAccessException, InstantiationException {
this.variantInit = (Init) BuildConfig.YANDEX_MAPKIT_INIT_CLASS.newInstance();
}
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
variantInit.onAttachedToEngine(binding);
}
стало
public class YandexMapkitPlugin implements FlutterPlugin, ActivityAware {
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
BuildConfig.YANDEX_MAPKIT_INIT.onAttachedToEngine(binding);
}
и если FlutterEngine-ов больше одного, то после уничтожения олного из них программа падает при уничтожении другого
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.common.MethodChannel.setMethodCallHandler(io.flutter.plugin.common.MethodChannel$MethodCallHandler)' on a null object reference
at com.unact.yandexmapkit.full.InitFull.teardownChannels(InitFull.java:62)
at com.unact.yandexmapkit.full.InitFull.onDetachedFromEngine(InitFull.java:35)
at com.unact.yandexmapkit.YandexMapkitPlugin.onDetachedFromEngine(YandexMapkitPlugin.java:18)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:272)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:280)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:288)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:123)
at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:467)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:752)
at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:875)
В приложении реализована фоновая обработка событий как описано в Background processes и в ходе которой создается отдельный FlutterEngine и потом, после обработки события. уничтожается. Проблема в том, что при этом возникает крэш
Приложение собрано Flutter 3.19.6
The text was updated successfully, but these errors were encountered: