【发布时间】:2014-04-08 20:25:13
【问题描述】:
我有一个 Scala Android 应用,使用 SBT 和 android-sdk-plugin 构建。
我需要包含 Google play-services 库,以使用 Google Maps API v2。它包含资源和代码。
阅读the android-sdk-plugin doc后,我看到了这个:
Using the google gms play-services aar:
libraryDependencies +=
"com.google.android.gms" % "play-services" % "3.1.36"
我已经这样做了,但是当我通过 sbt 编译我的应用程序时,我收到了这个错误: AndroidManifest.xml:34:错误:错误:找不到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)
对我来说,这是不包括播放服务资源的明显症状。它们必须从 AndroidManifest.xml 中引用:
<application android:name="...">
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
...
</application>
使用 Gradle,我没有遇到这个问题,使用相同的 AndroidManifest.xml 和依赖项设置。
我也尝试过使用android-plugin 的方式来做这件事,但没有成功。 android-sdk-plugin 不理解 aarlib() 语法。
使用播放服务的正确方法是什么?
【问题讨论】:
标签: android google-maps scala sbt