NativeScript / NativeScript/plugins
Android crash when displaying a custom marker info window using markerInfoContents
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 206
- Forks
- 123
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/google-maps/index.android.ts at the markerInfoContents handling that adds info.view to a GridLayout. Verify the returned native view is the wrapper container, then reproduce by repeatedly opening markers and confirm custom information windows no longer trigger the already-parented-child crash on Android.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100