[英]Android: ANT build fails with google-play-services-lib: “resolve to a path with no project.properties file for project”
[英]library resolve to a path with no project.properties file
我無法使用Jenkins構建項目並引用Sherlock項目庫。
我可以在我的本地系統上使用ant構建項目。 問題似乎是在構建服務器上引用Sherlock庫。
我將環境變量傳遞給ant,其中包含Sherlock庫項目的相對路徑:
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
我剛才有同樣的事情發生在我身上。 我使用Windows和Mac進行開發。 我想在兩個平台上測試我的項目。 它在我的Windows機器上構建得很好,但在我的Mac上壞了。 當我在Mac上查看我的Android應用程序(而不是庫項目)中的project.properties時,我看到我的庫項目以這種方式引用:
android.library.reference.1=LibraryProjects\\my_lib_project
我把它改成了下面的一行,它工作得很好!
android.library.reference.1=LibraryProjects/my_lib_project
我通過編輯和檢查具有相同屬性的project.properties文件解決了這個問題: android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library
我不確定它為什么會起作用。 為什么ant會關心Jenkins傳入的屬性與項目屬性文件中聲明的屬性?
現在我在project.properties文件中有兩個路徑:一個用於本地構建,一個用於構建在Jenkins上。
我有類似的問題,錯誤../google-play-services_lib解析為沒有project.properties文件的項目的路徑 。 它必須在Jenkins CI(Cloudbees)中工作,因此無需編輯手動project.properties。
我的解決方案是替換android update lib-project --path ...
與丑陋但工作的echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties
Jenkins shell命令中的echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties
。
我有這個問題,因為我沒有使用android
工具下載谷歌播放服務包。 當我檢查我的android sdk目錄($ ANDROID_HOME)時,沒有“$ ANDROID_HOME / extras / google”文件夾。
我通過運行android
並下載額外部分中的“Google Play服務”來修復此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.