【发布时间】:2017-08-16 05:02:56
【问题描述】:
这是我要修复的错误:
描述:错误:错误:找不到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)。 资源: AndroidManifest.xml 位置: 第 75 行 类型: Android AAPT 问题
我正在尝试实施我在https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project 看到的解决方案,在“其他”标签的“将 Google Play 服务添加到您的项目”下。我已经在我的 app/build.grandle 文件的依赖项 {} 部分中使用以下行修复了 Android Studio 中的此错误:
compile 'com.google.android.gms:play-services:9.0.2'
但是,对于特殊情况,我这次需要在 Eclipse ADT 中实现相同的修复。使用 Eclipse Android SDK Manager,我已经安装了 Google Play 服务,修订版 39:
我可以确认它已安装在我的计算机上的 C:\Users\jaimemontoya\android-sdks\extras\google\google_play_services:
在https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project 的说明中,它说:“将 /extras/google/google_play_services/libproject/google-play-services_lib/ 中的库项目复制到您维护 Android 应用项目的位置。”
如上图所示,我的 Google Play 服务修订版 39 安装中没有 /extras/google/google_play_services/libproject/google-play-services_lib/ 文件夹。有什么想法吗?
【问题讨论】:
-
Google 不久前停止支持 ADT。其中一部分不再将 Play Services 作为常规库项目提供(而且我不确定它是否会起作用)。我不知道在 Eclipse+ADT 中使用 Play Services 或其他任意库的可靠当前方法。我鼓励您重新审视“特殊情况”并将此项目迁移到当前维护的构建系统(例如 Gradle)。
-
通过“将此项目迁移到当前维护的构建系统(例如 Gradle)”,您是指 Android Studio,还是带有 Grandle 构建系统的 Eclipse?我已经在 Android Studio 中修复了这个错误,但正如我所提到的,对于特殊情况,我现在需要在 Eclipse 中实现相同的修复。
-
不知道有没有稳定的Eclipse环境支持Gradle和Android Plugin for Gradle。 Eclipse 的 Andmore 倡议最终应该会填补这个空白,但我不知道它的状态。此外,可能有 Eclipse 配方使用 Maven 作为可以容纳 AAR 的构建系统。
标签: android eclipse google-play-services eclipse-adt