Ionic v2 Google Maps API Android Build Error: cannot access AbstractSafeParcelable options.compassEnabled(controls.getBoolean(“compass”));

后端 未结 1 839
清酒与你
清酒与你 2020-12-10 11:25

I\'m trying to implement the Google Maps API using the Ionic docs as seen here.

I\'m using the code samples exactly as supplied, but I\'m getting the following error

相关标签:
1条回答
  • 2020-12-10 12:06

    I was able to resolve the issue. While a lot of the suggestions I found revolved around installing missing repositories (you need Android Support Repository, Library, Play Services and Google Repository), I had all that in place. What was missing was that incorrect versioning is specified in project.properties when I used this command to add the plugin:

    ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
    

    In project.properties, I changed this:

    cordova.system.library.4=com.google.android.gms:play-services-maps:9.8.0
    cordova.system.library.5=com.google.android.gms:play-services-location:9.8.0
    

    To this:

    cordova.system.library.4=com.google.android.gms:play-services-maps:+
    cordova.system.library.5=com.google.android.gms:play-services-location:+
    

    That resolved the build error.

    0 讨论(0)
提交回复
热议问题