且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ionic v2 Google Maps API Android 构建错误:无法访问 AbstractSafeParcelable options.compassEnabled(controls.getBoolean(“compass"));

更新时间:2023-11-20 10:03:52

我解决了这个问题.虽然我发现的很多建议都围绕安装缺少的存储库(您需要 Android Support Repository、Library、Play Services 和 Google Repository),但我已经准备好了所有这些.缺少的是,当我使用此命令添加插件时,在 project.properties 中指定了不正确的版本控制:

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"

在 project.properties 中,我改变了这个:

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

为此:

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

解决了构建错误.