I have managed to work this out. I think it boils down a minor pathing error in the current Google Play SDK and missing instructions in the official documentation for command line building. I can only assume most people use Eclipse which is able to cope with these issues automatically. I am old school a prefer to run my tool chain on Linux using vi
and make
. I think we are a dying breed but I will post my fixes in case anyone else is attempting the same approach. My solution can most likely be streamlined by removing the symbolic links, but this is what worked for me and I don’t want to break it!
I am using
SDK-Tools: 22.3
SDK Platform-tools: 19.0.1
SDK Build-tools: 19.0.1
SDK Platform: 19.2
ARM EABI v7a image: 19.2
Android Support Lib: 19.0.1
Google Play Services: 13
Google Play APK Expansion: 3
Google Play Licensing: 2
1) Setup symlinks to handle references to the old market paths:
$ cd ~/bin/android-sdk-linux/extras/google
$ ln -s play_apk_expansion market_apk_expansion
$ ln -s play_licensing market_licensing
2) Create licensing project and build library:
$ android update project --path ~/bin/android-sdk-linux/extras/google/market_licensing/library --target 1
$ cd ~/bin/android-sdk-linux/extras/google/play_licensing/library
$ ant release
3) Create apk expansion project, fix licensing project path and build library:
$ android update project --path ~/bin/android-sdk-linux/extras/google/market_apk_expansion/downloader_library --target 1
$ cd ~/bin/android-sdk-linux/extras/google/play_apk_expansion/downloader_library
$ sed -i 's,../market_licensing,../../market_licensing/library,g' project.properties
$ ant release
4) Update app project to use apk expansion library:
$ android update project --path ~/path/to/myproj.android --library ~/bin/android-sdk-linux/extras/google/market_licensing/library --library ~/bin/android-sdk-linux/extras/google/market_apk_expansion/downloader_library
5) Edit app project.properties
and change the path in android.library.reference.1
to use relative path and not absolute as absolute paths fail to work.
I hope this proves useful to others until Google fix the market references and add these instructions to their documents.... ;)
沒有留言:
張貼留言