Last active
December 23, 2024 19:55
-
-
Save rknell/8857002 to your computer and use it in GitHub Desktop.
Build Android Release apk from Cordova /CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/ | |
#USAGE! | |
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url) | |
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help | |
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!) | |
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!) | |
# 5. Check path/to/my/project/Release/android for your sparkling new apk! | |
# | |
# This worked and was uploadable to the google play store. | |
cordova build android --release | |
ant release -f platforms/android/build.xml | |
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore <AndroidKeyName>.keystore platforms/android/bin/<ProjectName>-release-unsigned.apk <AndroidKeyNameAlias> | |
mkdir -p Release/android | |
zipalign -f 4 platforms/android/bin/<ProjectName>-release-unsigned.apk Release/android/<ProjectName>-release.apk |
New URL for mentioned blog post: https://chris-allen-lane.com/blog/post/phonegap-compiling-a-release-apk-without-using-phonegap-build/
ant release -f platforms/android/build.xml
Buildfile: platforms\android\build.xml does not exist!
how to solve this?
i got the same error
@technomacx and @danielpa9708 im sure this is old (I didn't realise anybody had commented on this gist)
You might need to recreate the platform, ie cordova platform rm android && cordova platform add android
etc
The build.xml should be created automatically but if you checked the project out of source control it may not have been committed the first time?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!