Title: [@nativescript/google-maps] CameraUpdate.fromCameraPosition causes NullPointerException: CameraPosition must not be null · Issue #638 · NativeScript/plugins · GitHub
Open Graph Title: [@nativescript/google-maps] CameraUpdate.fromCameraPosition causes NullPointerException: CameraPosition must not be null · Issue #638 · NativeScript/plugins
X Title: [@nativescript/google-maps] CameraUpdate.fromCameraPosition causes NullPointerException: CameraPosition must not be null · Issue #638 · NativeScript/plugins
Description: On Android, using GoogleMaps.CameraUpdate.fromCameraPosition() to update the map's camera, especially when including bearing, results in a java.lang.NullPointerException from the native Google Maps SDK. Steps to Reproduce Set up a blank ...
Open Graph Description: On Android, using GoogleMaps.CameraUpdate.fromCameraPosition() to update the map's camera, especially when including bearing, results in a java.lang.NullPointerException from the native Google Maps...
X Description: On Android, using GoogleMaps.CameraUpdate.fromCameraPosition() to update the map's camera, especially when including bearing, results in a java.lang.NullPointerException from the native Google ...
Opengraph URL: https://github.com/NativeScript/plugins/issues/638
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[@nativescript/google-maps] CameraUpdate.fromCameraPosition causes NullPointerException: CameraPosition must not be null","articleBody":"On Android, using GoogleMaps.CameraUpdate.fromCameraPosition() to update the map's camera, especially when including bearing, results in a java.lang.NullPointerException from the native Google Maps SDK.\n\n\n**Steps to Reproduce**\n\n- Set up a blank nativescript-vue project\n\n- Initialize a nativescript/google-maps MapView.\n\n- Attempt to create a CameraUpdate using GoogleMaps.CameraUpdate.fromCameraPosition() with a valid CameraPosition object.\n\n\n``` typescript\nimport * as GoogleMaps from '@nativescript/google-maps';\n\n// Assume 'map' is an initialized GoogleMaps.GoogleMap instance\n// Assume 'map.cameraPosition' has valid data.\n// Assume 'newHeading' is a valid number (e.g., from device orientation).\n\nconst newCameraPosition: GoogleMaps.CameraPosition = {\n target: map.cameraPosition.target,\n zoom: map.cameraPosition.zoom,\n tilt: map.cameraPosition.tilt,\n bearing: newHeading, // Or any valid number, e.g., 20\n};\n\nconsole.log('Input newCameraPosition:', JSON.stringify(newCameraPosition)); // This logs a valid object\n\ntry {\n const cameraUpdate = GoogleMaps.CameraUpdate.fromCameraPosition(newCameraPosition);\n // This line below is never reached\n console.log('CameraUpdate created successfully.'); \n} catch (e: any) {\n console.error(\"Error creating CameraUpdate:\", e);\n if (global.isAndroid \u0026\u0026 e.nativeException) {\n console.error(\"Native Android Exception:\", e.nativeException);\n }\n}\n````\n\n**Observed Error :**\n\n```\nError creating CameraUpdate fromCameraPosition: Error: java.lang.NullPointerException: cameraPosition must not be null\nNative Android Exception during CameraUpdate creation: java.lang.NullPointerException: cameraPosition must not be null\n```\n\n**Context \u0026 Impact :**\n\n- The newCameraPosition JavaScript object supplied to fromCameraPosition is confirmed to be valid (no null, undefined, or NaN values).\n\n- This specific NullPointerException indicates an issue in the plugin's native bridge when converting the JavaScript CameraPosition object for fromCameraPosition.\n\n- As per the plugin's CameraUpdate API, fromCameraPosition is the only method that allows for setting the bearing alongside other camera parameters. \n\n- This bug currently prevents any programmatic control over the map's bearing, which is critical for features like compass-oriented maps.\n\n**Environment**\n \n- nativescript-vue: \"3.0.1\"\n- @nativescript/google-maps : \"1.8.0\"\n- Platform: Android\n- Device Model: emulated Pixel 4 but also on hardware","author":{"url":"https://github.com/tzhf","@type":"Person","name":"tzhf"},"datePublished":"2025-07-26T23:32:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/638/plugins/issues/638"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:543930af-d8ca-d95f-0ca6-5c624785aa09 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7F6:17CA4E:75754B:A0BBB5:69728398 |
| html-safe-nonce | d2a7e03bfefe6f4b03c12b4551cf640367a018c7eeb652cf429861859aabefea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0Y2OjE3Q0E0RTo3NTc1NEI6QTBCQkI1OjY5NzI4Mzk4IiwidmlzaXRvcl9pZCI6IjgyMjA2OTgyNzM5NjY2MjE1OTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 73dff86f600283178cc8d3b45464e7c1d96bfb298e602439634c6abaab073067 |
| hovercard-subject-tag | issue:3266285292 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/plugins/638/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4884626b56a2ee5575fa8c0162612fcab27409e831805bce68b9e0298184dba7/NativeScript/plugins/issues/638 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4884626b56a2ee5575fa8c0162612fcab27409e831805bce68b9e0298184dba7/NativeScript/plugins/issues/638 |
| og:image:alt | On Android, using GoogleMaps.CameraUpdate.fromCameraPosition() to update the map's camera, especially when including bearing, results in a java.lang.NullPointerException from the native Google Maps... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tzhf |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7631aa5e32c11c73e45f19f2aaeaa7e0305d2ec80414866e8b020f3c2144ccae |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/plugins git https://github.com/NativeScript/plugins.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 288901292 |
| octolytics-dimension-repository_nwo | NativeScript/plugins |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 288901292 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/plugins |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 40f44656d2185a364dd710032a2e10ee2f1d7e20 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width