【问题标题】:Integrating both Google Maps API and Nokia X HERE reference libraries for Google Maps API in one APK在一个 APK 中集成 Google Maps API 和 Nokia X HERE 参考库,用于 Google Maps API
【发布时间】:2014-02-25 16:00:42
【问题描述】:
我正在研究将 Google Maps API 和 Nokia X HERE 参考库集成到一个 APK 中 - 此处为文档 http://developer.nokia.com/resources/library/nokia-x/here-maps/one-apk-with-here-maps-and-google-maps.html
我按照文档页面上的视频教程中的步骤操作,在尝试将支持库添加到项目时遇到了以下问题。任何线索如何继续?
[2014-02-25 16:06:45 - Dex Loader] 无法执行 dex:多个 dex 文件定义 Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
[2014-02-25 16:06:45 - MapsDemo] 转换为 Dalvik 格式失败:无法执行 dex:多个 dex 文件定义 Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
【问题讨论】:
标签:
android
google-maps
here-api
nokiax
【解决方案1】:
看起来您已向项目添加了两次支持库。我认为您已将其添加为外部 jar,并且它也在您的项目 /libs 中。
如果您使用的是 Eclipse,请右键单击项目并导航到 Java Build Path -> Libraries,您可能会看到 android-support-v4.jar 在那里列出了两次:作为外部 jar 并在Android 私有库。删除不在Android Private Libraries下的那个。
无耻插件:运行该页面提到的 Github 演示要容易得多:
# clone HERE samples
$ git clone https://github.com/nokia-developer/nokia-x-here-maps-samples
$ cd nokia-x-here-maps-samples
# init submodules
$ git submodule update –init
# launch emulator (you need to create one first)
$ emulator -avd AVD_for_Nokia_X
# build and install debug version of MapsV1OneApk
$ cd MapsV1OneApk
$ ./gradlew installDebug # OS X/Linux
$ gradlew installDebug # Windows
# build and install debug version of MapsV2OneApk
$ cd ..
$ cd MapsV2OneApk
$ ./gradlew installDebug # OS X/Linux
$ gradlew installDebug # Windows
注意您需要为上述演示修改 AndroidManifest.xml 并插入有效的 HERE/Google 地图键才能真正看到地图。
【解决方案2】:
您可以尝试多次检查包含哪个库。我会先尝试取消选中 android 私有库。