App crashes on creating map
See original GitHub issueDescribe the bug I installed this plugin, updated the specific files as described and built the app. The build was successful but the app crashes at the point of creating the map. I checked the api key and it is okay since it works well when I use it elsewhere. This is the crash log
java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object
reference at com.hemangkumar.capacitorgooglemaps.CapacitorGoogleMaps$1.run(CapacitorGoogleMaps.java:135) at
android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6543) at
java.lang.reflect.Method.invoke(Native Method) at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
To Reproduce Steps to reproduce the behavior:
- Install the plugin
- Build the app
- Run the app
- See error
Expected behavior The map should display when the app is run.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to fix Maps when it crashes - Android - Google Maps Help
On your Android phone or tablet, open the Settings app . · Tap Apps & notifications. · Follow the steps on your device...
Read more >App crashes on creating map · Issue #114 - GitHub
Steps to reproduce the behavior: Install the plugin; Build the app; Run the app; See error ... The map should display when the...
Read more >App Crashing with MapKit | Apple Developer Forums
I've been trying to add a MapKit to my app where you can see a location on the map. I'm not trying to...
Read more >How to fix Map App (Crashes on Windows 10)?
Try re-registering Maps app. Perform these steps: 1. Search for Windows PowerShell using Cortana or Windows Search. 2. From results, right click ...
Read more >Top 8 Ways to Fix Google Maps Keeps Crashing on Android
1. Force Stop Google Maps · 2. Restart Your Device · 3. Check App Permissions · 4. Clear Cache and Data · 5....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Somehow, the latitude and longitude parameters that where suppossedly optional in the CapacitorGoogleMaps.create were causing the error when not provided, so you need to provide those fields
const boundingRect = this.yourMapView.nativeElement.getBoundingClientRect() as DOMRect; CapacitorGoogleMaps.create({ width: Math.round(boundingRect.width), height: Math.round(boundingRect.height), x: Math.round(boundingRect.x), y: Math.round(boundingRect.y), zoom: 5, latitude:xxxxxxxxx, // you can get the location and add the latitude longitude:xxxxxxx. // you can get the location and add the longitude });
ok, i will look into it