I am able to install a debug build onto emulator doing:
ant debug install
but am unable to install a release build. My steps:
1. ant release
2. jarsigner -verbose -keystore ..\my-release-key.keystore bin\myapp-release-unsigned.apk mykey
3. ren bin\myapp-release-unsigned.apk bin\myapp-release-signed.apk
4. zipalign -v 4 myapp-release-signed.apk myapp-release.apk
5. adb install bin\myapp-release.apk
All steps run successfully except the last one where I get a message:
82 KB/s (388012 bytes in 4.613s)
pkg: /data/local/tmp/myapp-release.apk
Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
I have also tried doing ant installr
instead of adb install bin\myapp-release.apk
with the same result
EDIT: I think this has to do with the key, since that is the only difference I can see between release and debug builds. I generated the key using:
keytool -genkey -v -keystore my-release-key.keystore
-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
as mentioned on http://developer.android.com/guide/publishing/app-signing.html. I modified ant.properties
file per http://developer.android.com/guide/developing/building/building-cmdline.html and now just doing ant release install
(instead of the steps above) but still running into same problem. If someone knows how does ant generate the debug key, then I could follow same procedure to generate my release key and see if that solves the problem.