Ionic v2 Google Maps API Android 构建错误:无法访问 AbstractSafeParce

Ionic v2 Google Maps API Android Build Error: cannot access AbstractSafeParcelable options.compassEnabled(controls.getBoolean(quot;compassquot;));(Ionic v2 Google Maps API Android 构建错误:无法访问 AbstractSafeParcelable options.compassEnab
本文介绍了Ionic v2 Google Maps API Android 构建错误:无法访问 AbstractSafeParcelable options.compassEnabled(controls.getBoolean("compass"));的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试使用 Ionic 文档实现 Google Maps API 如此处所示.

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:

BUILD FAILED

Total time: 2.748 secs

Error: /path/to/platforms/android/gradlew: Command failed with exit code 1 Error output:
/path/to/platforms/android/src/plugin/google/maps/GoogleMaps.java:479: error: cannot access AbstractSafeParcelable
        options.compassEnabled(controls.getBoolean("compass"));
               ^
  class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details

有人看到/解决了这个问题吗?

Has anyone seen/resolved this issue?

推荐答案

我能够解决这个问题.虽然我发现很多建议都围绕着安装缺少的存储库(您需要 Android 支持存储库、库、Play 服务和 Google 存储库),但我已经准备好了.缺少的是当我使用此命令添加插件时,在 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:+

这解决了构建错误.

这篇关于Ionic v2 Google Maps API Android 构建错误:无法访问 AbstractSafeParcelable options.compassEnabled(controls.getBoolean("compass"));的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)