note11g / flutter_naver_map

Naver Mobile Dynamic Map SDK for Flutter (unofficial)
BSD 3-Clause "New" or "Revised" License
142 stars 69 forks source link

PlatformException(error, overlay can't found because it's null, null, Java, Lang. IllegalArgumentException: overlay can't found because it's null #274

Open baekjungkim opened 1 month ago

baekjungkim commented 1 month ago

화면에 처음 진입시에는 괜찮은데 화면 재 진입시에 해당 에러가 발생합니다(가끔 처음 진입시에도 에러날때 있음)

E/MethodChannel#flutter_naver_map_overlay#5(25655): Failed to handle method call
E/MethodChannel#flutter_naver_map_overlay#5(25655): java.lang.IllegalArgumentException: overlay can't found because it's null
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handler(OverlayController.kt:109)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.$r8$lambda$9L2aH7F40vWkimuQuN2mrtZZ86c(Unknown Source:0)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at dev.note11.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$$ExternalSyntheticLambda0.onMethodCall(D8$$SyntheticClass:0)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at android.app.ActivityThread.main(ActivityThread.java:8810)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
E/MethodChannel#flutter_naver_map_overlay#5(25655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Debug 모드로 에러가 잡히고(자세하게 어디서 잡히는지는 모름..) 계속(F5) 버튼을 누르면 아래 에러가 다시 발생하고 클러스터와 함께 마커가 출력이 됩니다.

[Error] PlatformException(error, overlay can't found because it's null, null, Java, Lang. IllegalArgumentException: overlay can't found because it's null
at dev.notell.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.handler(OverlayController.kt:109)
at dev.notell. flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController.$8$1ambda$9LZaH7F40vIkimuQuN2mrtZZ86c(Unknown Source:0)
at dev.notell.flutter_naver_map.flutter_naver_map.controller.overlay.OverlayController$$ExternalSyntheticLambda0.onMethodCall(D8S$SyntheticClass:0)
at 1o.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessageMethodchannel. java: 267)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java: 292)
at 1o.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueueS0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java: 319)
at 1o.flutter.embedding.engine.dart.DartMessengerS$ExternalSyntheticLambda0.run(D8$SSyntheticClass:0)
at android.os.Handler.handlecallback(Handler.java: 942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper. loopOnce(Looper.java: 226)
at android.os.Looper.loop(Looper.java: 313)
at android.app.ActivityThread.main(ActivityThread.java: 8810)
at java. lang.reflect.Method. invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Runtimelnit.java: 604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 1067)
#O
#1
#2
StandardMethodCodec. decodeEnvelope (package: flutter/src/services/message_codecs.dart:648:7)
MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
‹asynchronous suspension>
_NOverlaySender._send (package: flutter_naver_map/src/type/map/overlay/overlay/overlay_sender. dart: 24:19)
note11g commented 1 month ago

안녕하세요, 오류를 제보해주셔서 감사드립니다. 재현조건 조사를 위해, 해당 오류를 재현할 수 있는 최소 재현 코드를 부탁드려도 괜찮을까요?

baekjungkim commented 1 month ago

안녕하세요, 오류를 제보해주셔서 감사드립니다. 재현조건 조사를 위해, 해당 오류를 재현할 수 있는 최소 재현 코드를 부탁드려도 괜찮을까요?

final markerList = await fetchMarkerList(userId);

final clusterMarker = [];

for(final marker in markerList) {
  final response = await http.get(Uri.parse(marker.imageUrl));
  final imageMemory = response.bodyBytes;
  final imageIcon = await NOverlayImage.fromByteArray(imageMemory);
  final position = NLatLng(marker.latitude,marker.longitude);

  final cluster = NClusterableMarker(
    id: marker.id,
    position: position,
    icon: imageMarker,
  )

  clusterMarker.add(cluster);
}

await controller.addOverlayAll(clusterMarker.toSet());

이렇게 되어있습니다. 안드로이드에서만 테스트 해보았습니다

note11g commented 3 weeks ago

@baekjungkim "클러스터와 마커가 함께 보여진다"고 말씀해주셨는데, 혹시 해당 현상이 일어나는 스크린샷을 제공해주실 수 있으실까요?

baekjungkim commented 2 weeks ago

@baekjungkim "클러스터와 마커가 함께 보여진다"고 말씀해주셨는데, 혹시 해당 현상이 일어나는 스크린샷을 제공해주실 수 있으실까요?

@note11g 마커는 제대로 출력이 된다는 말이었습니다. 안드로이드에서 디버그에서 실행시 에러가 발생됩니다.