NativeScript / NativeScript/plugins

Android crash when displaying a custom marker info window using markerInfoContents

オープン 初心者向け
#680 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
206
フォーク
123
平均マージ
2日 1時間
マージ済み PR(30日)
1

説明

Android crash when displaying a custom marker info window using markerInfoContents

Using markerInfoContents to display a custom NativeScript view causes Android to crash on API 36, API 37, and a physical Android device.

Error

java.lang.IllegalStateException:
The specified child already has a parent.
You must call removeView() on the child's parent first.

Cause

In packages/google-maps/index.android.ts, the plugin adds info.view to a GridLayout container but returns the child:

container.addChild(info.view)
return info.view.nativeView

Because the returned child already belongs to the container, Google Maps attempts to attach an already-parented view.

Suggested fix

Return the wrapper container instead:

return container.nativeView

The custom information-window view should display without crashing when repeatedly opening markers.

Image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

packages/google-maps/index.android.ts の、info.view を GridLayout に追加する markerInfoContents の処理から始めます。返される native view が wrapper container であることを確認し、その後、marker を繰り返し開いて再現し、custom information windows が Android で already-parented-child crash を引き起こさなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, typescript
領域
mobile-dev
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
92/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。