library resolve to a path with no project.properti

2020-08-12 06:44发布

问题:

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

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

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

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

I'm getting this error.

**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

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

It has these properties:

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

回答1:

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


回答2:

I solved the issue by editing and checking in the project.properties file with the same property: android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library

I'm not sure why it works. Why would ant care if the property is passed in by Jenkins vs. declared in the project's property file?

Now I have two paths in my project.properties file: one for a local build and one for the build on Jenkins.



回答3:

I had similar issue with error ../google-play-services_lib resolve to a path with no project.properties file for project. It has to work in Jenkins CI (Cloudbees), so no manual project.properties editing.

My solution was to replace android update lib-project --path ... with ugly but working echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties in Jenkins shell command.



回答4:

I had this problem because I hadn't downloaded the google play services package using the android tool. When I checked my android sdk directory ($ANDROID_HOME) there was no "$ANDROID_HOME/extras/google" folder.

I fixed this by running android and downloading "Google Play services" found in the extras section.