本文介绍了库解析为没有 project.properties 文件的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Jenkins 构建项目和引用 Sherlock 项目库时遇到问题.

I'm having trouble building my project with Jenkins and referencing the Sherlock project library.

我可以在本地系统上使用 ant 构建项目.问题似乎是在构建服务器上引用了 Sherlock 库.

I can build the project with ant on my local system. The problem seems to be referencing the Sherlock library on the build server.

我向 ant 传递了一个环境变量,其中包含 Sherlock 库项目的相对路径:

I pass an environment variable to ant with the relative path to the Sherlock library project:

android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library

我收到此错误.

**BUILD FAILED**
/SDK/android-sdk-macosx/tools/ant/build.xml:595:
The following error occurred while executing this line:
/SDK/android-sdk-macosx/tools/ant/build.xml:571:
../../buildlibraries/androidlibraries/sherlock/library resolve to a path with
no project.properties file for project /Users/Jenkins/buildlibraries/androidlibraries/sherlock/library

我检查过,该位置确实存在 project.properties 文件.

I checked and a project.properties file does exist at that location.

它具有以下属性:

android.library=true
# Project target.
target=android-14

推荐答案

我刚才也遇到了同样的事情.我同时使用 Windows 和 Mac 进行开发.我需要在两个平台上测试我的项目.它在我的 Windows 机器上构建得很好,但在我的 Mac 上坏了.当我在 Mac 上查看我的 Android 应用程序(不是库项目)中的 project.properties 时,我看到我的库项目是这样引用的:

I had the same thing happen to me just now. I use both a Windows and Mac to develop with. I watne d to test my project on both platforms. It built just fine on my Windows machine, but broke on my Mac. When I looked at my project.properties in my Android application (not library projects) on the Mac, I saw that my library projects were referenced this way:

android.library.reference.1=LibraryProjects\\my_lib_project

我把它改成了下面这行,效果很好!

I changed it to the line below, and it worked just fine!

android.library.reference.1=LibraryProjects/my_lib_project

这篇关于库解析为没有 project.properties 文件的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:02