我有一个Android项目,我正在尝试使用地图等服务,所以我开始知道我需要使用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或说无效文件?
答案 0 :(得分:10)
此处ant
未能生成您的构建,因为Google不再为Play库提供build.xml,我们需要通过运行以下命令在Play库中生成build.xml
android update lib-project --path <playlib_path>
现在我们需要在eclipse中清除google_play_services_lib
和your_project