team-mount-ventoux / JayPS-AndroidApp

JayPS (Pebble Bike/Ventoo) Android App
http://www.pebblebike.com
MIT License
44 stars 14 forks source link

How to compile? #7

Open halkeye opened 11 years ago

halkeye commented 11 years ago

After a lot of trial and error, I managed to get ant running. So far I've run:

$ANDROID_HOME/tools/android update project -p . -n com.njackson.pebblecycling 
perl -pi -e 's{android.library.reference.2=.*$}{android.library.reference.2=submodules/google-play-services_lib}' project.properties
rm -rf submodules/google-play-services_lib
cp -a $ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib/ submodules/
$ANDROID_HOME/tools/android update lib-project -p submodules/google-play-services_lib
$ANDROID_HOME/tools/android update lib-project -p submodules/ActionBarSherlock/actionbarsherlock

Only to fail out:

-compile:
    [javac] Compiling 17 source files to /var/lib/jenkins/jobs/android-cycling/workspace/bin/classes
    [javac] /var/lib/jenkins/jobs/android-cycling/workspace/src/com/njackson/GPSService.java:19: error: package fr.jayps.android does not exist
    [javac] import fr.jayps.android.AdvancedLocation;
    [javac]                        ^
    [javac] /var/lib/jenkins/jobs/android-cycling/workspace/src/com/njackson/GPSService.java:42: error: cannot find symbol
    [javac]     private AdvancedLocation _myLocation;
    [javac]             ^
    [javac]   symbol:   class AdvancedLocation
    [javac]   location: class GPSService
    [javac] /var/lib/jenkins/jobs/android-cycling/workspace/src/com/njackson/GPSService.java:105: error: cannot find symbol
    [javac]         _myLocation = new AdvancedLocation(getApplicationContext());
    [javac]                           ^
    [javac]   symbol:   class AdvancedLocation
    [javac]   location: class GPSService
    [javac] /var/lib/jenkins/jobs/android-cycling/workspace/src/com/njackson/GPSService.java:134: error: cannot find symbol
    [javac]         _this._myLocation = new AdvancedLocation(_this.getApplicationContext());
    [javac]                                 ^
    [javac]   symbol:   class AdvancedLocation
    [javac]   location: class GPSService
    [javac] Note: /var/lib/jenkins/jobs/android-cycling/workspace/src/com/njackson/GPSService.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 errors

BUILD FAILED
/var/lib/jenkins/tools/android-sdk/tools/ant/build.xml:713: The following error occurred while executing this line:
/var/lib/jenkins/tools/android-sdk/tools/ant/build.xml:727: Compile failed; see the compiler error output for details.
halkeye commented 11 years ago

huh

turns out adding source.dir = src;./submodules/AdvancedLocation/src/ to project.properties is the solution. I can fork and make a pull request if needed.

jay3 commented 11 years ago

I guess it depends how you've added the submodule in your IDE. With Eclipse, I had no such problem with AdvancedLocation, but I had to fix the line for google-play-services: android.library.reference.2=../../../../../../Applications/Android/android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib => android.library.reference.2=../google-play-services_lib

Jay