You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by jwebb <jw...@compunetix.com> on 2016/05/05 13:10:23 UTC

Problem installing .apk on Android 5.0.2 phone/Certificates problem

I'm having a problem getting the .apk file generated by the adt tool to
actually install on an Android phone running 5.0.2. I think the problem is
that the phone is not accepting the self-signed certificate I used to sign
the file with jarsigner. Is it possible Android now requires its own
certificate be used to sign the file? Clearly, apps generated with Android
Studio can be deployed to the phone.

Anyway, the steps I follow to sign and install the apk are:

keytool -genkey -v -keystore debug.keystore -alias TabletClient -keyalg RSA
-keysize 2048 -validity 20000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore
debug.keystore Release\TabletClient.apk TabletClient
zipalign -v 4 Release\TabletClient.apk Release\TabletClientZ.apk
adb install Release\TabletClientZ.apk

The error I'm getting from adb is INSTALL_PARSE_FAILED_NO_CERTIFICATES. And
adb logcat shows "java.lang.SecurityException: Can not recognize a critical
extension."

BTW I found on StackOverflow comments indicating that Java 6 should be used
to sign -- apparently Android had a problem with certificates generated
using Java 7 or 8 -- so I uninstalled everything but Java 6 from my PC and
did the above steps using it.

Another way to ask my question is, is there an explanation somewhere of how
to get the .apk file generated by adt to run on an Android phone?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Problem-installing-apk-on-Android-5-0-2-phone-Certificates-problem-tp12655.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Problem installing .apk on Android 5.0.2 phone/Certificates problem

Posted by jwebb <jw...@compunetix.com>.
I found the answer. The .apk was being signed as part of the build in adt,
but with a key that didn't work. For some reason the jarsigner step didn't
completely replace the old signature, or show any error. So when the .apk
was installed on the Android device it had a problem with the bad key.
The trick to finding this was to open the .apk file as a zip file before
running jarsigner, and then delete the META-INF directory. jarsigner then
created it correctly, with the key Android creates in the .android
directory.




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Problem-installing-apk-on-Android-5-0-2-phone-Certificates-problem-tp12655p12660.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Problem installing .apk on Android 5.0.2 phone/Certificates problem

Posted by Justin Ransom Dallas <ju...@gmail.com>.
Unsubscribe