Android crash when displaying a custom marker info window using markerInfoContents
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 92/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- android, typescript
- 領域
- mobile-dev
研究方向
從 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 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.
- 主要語言
- TypeScript
- 星號
- 206
- 分支
- 123
- 平均合併
- 2 天 1 小時
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NativeScript/plugins 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
NativeScript/plugins#671 ·
-
難度 1/5 1 小時以內 新手友好度 72/100
NativeScript/plugins#640 ·
-
難度 4/5 3-5 天 新手友好度 45/100
NativeScript/plugins#668 ·
-
難度 4/5 3-5 天 新手友好度 45/100
NativeScript/plugins#665 · 1 則留言 ·
-
NativeScript/plugins#660 · 1 個 reaction · 已指派 2 人 ·
查看 NativeScript/plugins 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
area:tools bug good first issue help wanted priority:P2
難度 2/5 1-3 小時 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·