Android:ANT 构建失败并显示 google-play-services-lib:“解析为没有项目的 project.properties 文件的路径"; [英] Android: ANT build fails with google-play-services-lib: "resolve to a path with no project.properties file for project"

查看:42
本文介绍了Android:ANT 构建失败并显示 google-play-services-lib:“解析为没有项目的 project.properties 文件的路径";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ANT 构建我的应用程序,但在我包含 google-play-services-lib 库项目后失败了.

I'm trying to build my apps using ANT and I'm failing miserably after I included the google-play-services-lib library project.

第一步

我在 project.properties 文件中设置了对库项目的引用:

I set up a reference to the library project in my project.properties file:

android.library.reference.1=/path/to/google-play-services_lib

第 2 步

我在 google-play-services_lib 文件夹中运行了这些命令:

I ran these commands inside the google-play-services_lib folder:

android update lib-project --path .
ant clean
ant release

构建成功!

步骤 3

回到我的项目文件夹

ant clean
ant release

错误

BUILD FAILED
/android/tools/ant/build.xml:460: /path/to/google-play-services_lib resolve to a path with no project.properties file for project /my/project-folder

自然而然,两个文件夹中都有一个 project.properties.google-play-services_lib 中的代码包含以下代码:

There IS a project.properties in both folders, naturally. The one in google-play-services_lib contains this code:

target=android-8
android.library=true

我显然遗漏了一些就在我面前的东西,非常感谢您的帮助.谢谢!

I'm obviously missing something that's right there in front of me and I'd really appreciate your help. Thanks!

推荐答案

尝试将 android 库引用更改为相对路径(相对于当前目录)而不是绝对路径.

Try changing the android library reference to a relative path (relative to the current directory) instead of an absolute path.

例如

android.library.reference.1=../../../relative_path/to/google-play-services_lib

这篇关于Android:ANT 构建失败并显示 google-play-services-lib:“解析为没有项目的 project.properties 文件的路径";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆