android - android 中的无效文件 : google-play-services_lib/build. xml

标签 android xml eclipse ant google-play-services

我有一个 android 项目,我在其中尝试使用 map 等服务,所以我开始知道我需要使用 google-play-services_lib 库。所以我只是从源 sdk(sdk/extras/google/google_play_services/libproject) 文件夹中取出它并将其复制到我计算机上的位置 /Users/name/android/ 。现在我将库导入到 Eclipse 中。接下来我从 eclipse 创建了一个对这个库的引用,比如 MyApp->Properties->Android->Library Section/Add 并且项目中没有错误,当我从 运行它时工作正常eclipse 但我只想通过终端运行它,在这里我移动到项目位置文件夹并尝试命令 ant clean 但收到以下错误

Buildfile: /Users/name/android/project/project_name/build.xml

-check-env:
 [checkenv] Android SDK Tools Revision 24.0.2
 [checkenv] Installed at /Users/name/andriod_installation/adt-bundle/sdk

-setup:
     [echo] Project Name: Project_name
  [gettype] Project Type: Application

-pre-clean:

clean:
   [delete] Deleting directory /Users/name/android/project/project_name/bin
   [delete] Deleting directory /Users/name/android/project/project_name/gen
[getlibpath] Library dependencies:
[getlibpath] 
[getlibpath] ------------------
[getlibpath] Ordered libraries:

BUILD FAILED
/Users/name/andriod_installation/adt-bundle/sdk/tools/ant/build.xml:470: Invalid file: /Users/name/android/google-play-services_lib/build.xml

Total time: 1 second

谁能告诉我 google_play_services_lib 或对其创建的引用有什么问题,为什么 ant 找不到 build.xml 或说文件无效?

最佳答案

此处 ant 无法生成您的构建,因为 Google 不再为 Play 库提供 build.xml,我们需要通过运行以下命令在 Play 库中生成 build.xml

android update lib-project --path <playlib_path>

现在我们需要在 eclipse 中清理 google_play_services_libyour_project

关于android - android 中的无效文件 : google-play-services_lib/build. xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28854856/

相关文章:

android - ListView 查看器模式。在哪里设置删除项目的位置标签。安卓

android - 如何使用 Google Studio 从多个数据源生成仪表板?

java - 创建 servlet 上下文资源 [WEB-INF/applicationContext.xml] 中定义的名称为 "datasource"的 bean 时出错

java - java 空赋值行为

Java透视图在eclipse中不可见

android - 如何在 android 布局中使用向上/向下滑动方法?

java - 如何以编程方式在 Android 的 RelativeLayout 中的按钮旁边显示 TextView ?

ios - 为什么我的 iOS 正则表达式不起作用?

java - 将新属性添加到 java 中的现有 XML 节点?

java - Android float 操作按钮未被识别