cordova-plugin-googlemaps icon indicating copy to clipboard operation
cordova-plugin-googlemaps copied to clipboard

Android and IOS app crashes

Open nitishbhardwaj1111 opened this issue 7 years ago • 56 comments

Android and IOS app crashes when navigating to maps page. But able to see the map on ionic cordova run browser -l

cordova plugin list

com.razorpay.cordova 0.16.1 "RazorpayCheckout"
cordova-android-firebase-gradle-release 2.1.0 "cordova-android-firebase-gradle-release"
cordova-android-play-services-gradle-release 2.1.0 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-fcm-with-dependecy-updated 2.4.0 "Cordova FCM Push Plugin"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-opener2 2.2.1 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.6.3-20190614-1928 "cordova-plugin-googlemaps"
cordova-plugin-ionic 5.3.1 "cordova-plugin-ionic"
cordova-plugin-ionic-webview 2.5.1 "cordova-plugin-ionic-webview"
cordova-plugin-nativegeocoder 3.2.2 "NativeGeocoder"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.4 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

@ionic-native/core :  "^4.4.0",
@ionic-native/google-maps : "^4.14.0",

ionic info : Screenshot 2019-07-16 at 7 50 44 PM

Current behavior:

  • App crashed when navigating to maps page.

Expected behavior:

  • App should show google map.

nitishbhardwaj1111 avatar Jul 16 '19 14:07 nitishbhardwaj1111

Please show me the crash log

wf9a5m75 avatar Jul 16 '19 14:07 wf9a5m75

Hi @wf9a5m75,

Nothing is showing in consoles, it just quit when trying to open the the page where map is implemented.

nitishbhardwaj1111 avatar Jul 17 '19 04:07 nitishbhardwaj1111

Please check logcat, not console.log.

wf9a5m75 avatar Jul 17 '19 05:07 wf9a5m75

Here is the logcat

2019-07-17 16:56:48.502 748-748/? E/cnss-daemon: Invalid mac address: 0x555555f110M
2019-07-17 16:57:13.231 748-748/? E/cnss-daemon: Stale or unreachable neighbors, ndm state: 4
2019-07-17 16:57:19.855 1562-1792/? E/WifiScanningService: Got invalid work source request: WorkSource{} from ClientInfo[uid=10013]
2019-07-17 16:57:21.705 1562-1832/? E/AppScanObserverService: Result available, null observers for user: 0
2019-07-17 16:57:21.747 1562-3444/? E/LocSvc_libulp: E/int ulp_brain_transition_all_providers(), no QUIPC/GNSS transition logic run due to both engines are OFF 
2019-07-17 16:57:21.750 1562-2100/? E/QMI_FW: QCCI qmi_cci_xport_recv: txn not found. svc_id: 16
2019-07-17 16:57:21.751 1562-2070/? E/LocSvc_LBSApiV02: E/virtual int lbs_core::LBSApiV02::injectCoarsePosition(const CoarsePositionInfo &):352]: Error : st = 3, ind.status = 0
2019-07-17 16:57:33.964 10331-10331/com.test.test E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test.test, PID: 10331
    java.lang.RuntimeException: API key not found.  Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
        at com.google.maps.api.android.lib6.drd.p.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):22)
        at com.google.maps.api.android.lib6.auth.d.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):10)
        at com.google.maps.api.android.lib6.impl.d.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):41)
        at com.google.android.gms.maps.internal.CreatorImpl.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):61)
        at com.google.android.gms.maps.internal.CreatorImpl.newMapViewDelegate(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):32)
        at com.google.android.gms.maps.internal.h.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):62)
        at hp.onTransact(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (040408-253824076):4)
        at android.os.Binder.transact(Binder.java:499)
        at com.google.android.gms.internal.maps.zza.transactAndReadException(Unknown Source)
        at com.google.android.gms.maps.internal.zzf.zza(Unknown Source)
        at com.google.android.gms.maps.MapView$zzb.createDelegate(Unknown Source)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.zza(Unknown Source)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(Unknown Source)
        at com.google.android.gms.maps.MapView.onCreate(Unknown Source)
        at plugin.google.maps.PluginMap$1.run(PluginMap.java:285)
        at android.os.Handler.handleCallback(Handler.java:754)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:165)
        at android.app.ActivityThread.main(ActivityThread.java:6375)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
2019-07-17 16:57:34.076 1562-1794/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1773, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]
2019-07-17 16:57:34.077 1562-1794/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=1772, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]
2019-07-17 16:57:34.081 469-2638/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
2019-07-17 16:57:34.109 6327-10535/? E/zeus-AndroidUtils-[pool-1-thread-8]: top : com.mi.android.globalFileexplorer
2019-07-17 16:57:34.109 6327-10535/? E/AD-PLUGIN-SplashController: get miui intent sender : null
2019-07-17 16:57:34.112 6327-10535/? E/zeus-AndroidUtils-[pool-1-thread-8]: top : com.mi.android.globalFileexplorer
2019-07-17 16:57:34.457 1167-1841/? E/fpc_tac: fpc_ree_device_wait_irq (fingerprint) pfd[1].revents 1
2019-07-17 16:57:34.473 10537-10537/? E/HAL: PATH3 /odm/lib64/hw/gralloc.qcom.so

nitishbhardwaj1111 avatar Jul 17 '19 11:07 nitishbhardwaj1111

Same here +1

RomanPoschl avatar Jul 17 '19 13:07 RomanPoschl

java.lang.RuntimeException: API key not found.  Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml

As the error log says, you don't set API key

wf9a5m75 avatar Jul 17 '19 14:07 wf9a5m75

but i did it in config.xml.

<preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="AIzaSyB****************6Q-jiKe81n0" />
<preference name="GOOGLE_MAPS_IOS_API_KEY" value="AIzaSyB8IixvlN*****************v3n8zulvQ" />

And package.json as well

"cordova-plugin-googlemaps": {
  "API_KEY_FOR_ANDROID": "AIzaSyB****************6Q-jiKe81n0",
  "API_KEY_FOR_IOS": "AIzaSyB8IixvlN*****************v3n8zulvQ",
  "PLAY_SERVICES_VERSION": "15.0.1",
  "ANDROID_SUPPORT_V4_VERSION": "27.+",
  "LOCATION_WHEN_IN_USE_DESCRIPTION": "This app wants to get your location while this app runs only.",
  "LOCATION_ALWAYS_USAGE_DESCRIPTION": "This app wants to get your location always, even this app runs in background."
}

nitishbhardwaj1111 avatar Jul 17 '19 14:07 nitishbhardwaj1111

Please share your project files on GitHub repository. I will check it

wf9a5m75 avatar Jul 17 '19 14:07 wf9a5m75

I have looked at some things so:
I tried googlemaps
version 2.6.1 - do not work version from branch multiple_pages - do not work

When I openned apk with Android studio in AndroidManifest.xml there is not API_KEY

I had installed environment today so here is some info:

node -v      
v10.16.0
npm -v
6.9.0
cordova -v
9.0.0 ([email protected])
cordova platform
Installed platforms:
  android 8.0.0

RomanPoschl avatar Jul 18 '19 00:07 RomanPoschl

As I wrote above, Please share your project files on GitHub repository. I will check it.

wf9a5m75 avatar Jul 18 '19 00:07 wf9a5m75

Sorry for that, but it is not possible to share the project files. Do we have any other option? As i also tried to add manually https://stackoverflow.com/a/42016903/10461403 but when running ionic cordova build android it delete that lines.

nitishbhardwaj1111 avatar Jul 18 '19 06:07 nitishbhardwaj1111

Another option is to create a simple project from scratch that reproduce your issue.

wf9a5m75 avatar Jul 18 '19 06:07 wf9a5m75

Do you still use Bitbucket? I can share with you only private repo. Also may I delete gitignore, so you will have all files?

RomanPoschl avatar Jul 18 '19 06:07 RomanPoschl

You can share your repo on bitbucket as well.

wf9a5m75 avatar Jul 18 '19 06:07 wf9a5m75

I sent you email with URL also added your account to repo. If you wanna I will upload full project without .gitignore for having full scope to the problem.

RomanPoschl avatar Jul 18 '19 06:07 RomanPoschl

Thanks, I will check it out tomorrow.

wf9a5m75 avatar Jul 18 '19 07:07 wf9a5m75

Hello any progres?

RomanPoschl avatar Jul 19 '19 11:07 RomanPoschl

Hi @wf9a5m75. I just shared a github invitation link of my project to your email. Please take a look into it. Thanks in advance.

nitishbhardwaj1111 avatar Jul 22 '19 05:07 nitishbhardwaj1111

+1

moshe5745 avatar Jul 23 '19 07:07 moshe5745

Thank you for sharing @Symorp and @nitish75

Umm, I've inspected both repository, and I tried to reproduce the same situation with the same cordova version and plugins. But not I can't reproduce the same situation.

The reason of crash in Android is cordova does not insert necessary xml nodes into AndroidManifest.xml.

wf9a5m75 avatar Jul 23 '19 20:07 wf9a5m75