【问题标题】:library resolve to a path with no project.properties file库解析为没有 project.properties 文件的路径
【发布时间】:2013-04-04 02:03:43
【问题描述】:

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

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

我通过 Sherlock 库项目的相对路径将环境变量传递给 ant:

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 文件。

它具有以下属性:

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

【问题讨论】:

    标签: android ant jenkins actionbarsherlock


    【解决方案1】:

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

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

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

    android.library.reference.1=LibraryProjects/my_lib_project
    

    【讨论】:

      【解决方案2】:

      我通过编辑并签入具有相同属性的 project.properties 文件解决了这个问题:android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library

      我不确定它为什么会起作用。为什么 ant 会关心属性是由 Jenkins 传入还是在项目的属性文件中声明?

      现在我的 project.properties 文件中有两个路径:一个用于本地构建,另一个用于在 Jenkins 上构建。

      【讨论】:

      • 你在哪里添加了 project.properties 文件?
      • 感谢您的解决方案。不幸的是,不知道为什么不能通过 Jenkins 传递它:\
      【解决方案3】:

      我遇到了类似的错误../google-play-services_lib resolve to a path without project.properties file for project。它必须在 Jenkins CI (Cloudbees) 中工作,因此无需手动编辑 project.properties。

      我的解决方案是在 Jenkins shell 命令中将 android update lib-project --path ... 替换为丑陋但有效的 echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties

      【讨论】:

        【解决方案4】:

        我遇到这个问题是因为我没有使用android 工具下载 google play 服务包。当我检查我的 android sdk 目录 ($ANDROID_HOME) 时,没有“$ANDROID_HOME/extras/google”文件夹。

        我通过运行 android 并下载附加部分中的“Google Play 服务”来解决此问题。

        【讨论】:

          猜你喜欢
          • 2013-01-13
          • 2012-03-20
          • 2012-09-11
          • 2013-06-05
          • 2013-06-04
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多