I generated a apk file by running
meteor build ~/output-dir --server=myapp.meteor.com
,
then got release-unsigned.apk in the folder output-dir, it looks good.
I copy this apk file to my Android phone and tried to install it, after install guide, it shows message App not installed.
I have installed some apk files built by java on my phone before, it works, so is there something I need handle when I install apk file built by meteor?
As the documentation states, you can't install unsigned applications on your Android phone:
Android requires that all apps be digitally signed with a certificate
before they can be installed.
As far as I can tell, you have the following two options to run your app:
Use an emulator to run your unsigned app or
sign your app.
To sign your app, you can use the steps, described in the Meteor guide for submitting Android apps to the Play Store:
Generate a private key using the keytool (skip this step, in case you already have a private key generated):
keytool -genkey -alias your-app-name -keyalg RSA -keysize 2048 -validity 10000
Sign your app using the jarsigner tool:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 unaligned.apk your-app-name
After that, you should be able to install and run your application on your Android phone.
Related
I got 'App not installed as package appears to be invalid' message when trying to install my signed release app manually on Android 12. However, it can be installed in my other phones which are Android 9 and Android 6.
I use jarsigner to sign my apk :
$ jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my-release-key.keystore <app-release-unsigned.apk's path> alias_name
And use zipalign to optimize :
$ zipalign -v 4 <path-to-same-apk-file> HelloWorld.apk
I've change my phone setting so that able to install unknown apk and tested with app-debug.apk and it works just fine. For more information, my app is written by using quasar framework and built by using cordova.
On Android 12, you have to use V2 signing scheme to sign your APK. Unfortunately, jarsigner is only v1 signing scheme.
In short, use apksigner to sign your APK in place or jarsigner, or if you use Android Studio, don't forget to check the "V2 signing" check box or define the signingConfig enabling v2 signing.
I'm trying to test google in app purchase system.
If I download from the app from google play, in app purchase works.
However if I run the app directly from android studio, I can't because of error code 5 or 0.
I think its because when running through android studio on test device its not signed. how do i do that ?
You need to sign it manually with your production keystore:
jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore "PATH" -storepass KEYSTORE_FILE app-unsigned.apk ALIAS_NAME
Then you maybe need to zipalign:
zipalign "-v" "4" "PATH TO SIGNED APK" out.apk
How to sign your APK or Android App Bundle in release mode in Visual Studio Native-Activity Application (Android) project?
When I rebuild solution and deploy solution in release ARM target, navigate to Release folder and drag and drop apk file to play.google.com (Play Store), there is following error message.
Upload failed
You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs or Android App Bundles.
You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode. Learn more about signing.
I have manged to generate and download deployment_cert.der on play store, but not sure how it can be added to apk in Visual Studio Native-Activity Application (Android) project.
Figered it out now.
Built APK file can be signed by using command line (without need of installing Android Studio). This can be done as follows:
1.) Bellow will allow to build unsigned APK in release mode:
.packing project Properties --> Ant --> Ant Build Target --> Release (Release Mode)
2.) Add JDK and Android SDK to PATH. In my case (installed by VS installer) those paths are:
C:\Program Files\Java\jdk1.8.0_172\bin
C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3
3.) Create keystore with key:
keytool -genkey -v -keystore my_app.keystore -alias alias_name -keyalg PSA -keysize 2048 -validity 10000
4.) Sign APK:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my_app.keystore My.App.Packaging-release-unsigned.apk alias_name
5.) ZIP align:
zipalign -f -v 4 My.App.Packaging-release-unsigned.apk My.App.apk
6.) Drag and drop to Play Store
I have written an Android app (target 3.2) using Eclipse 3.7, I tried to sign the App, but on the target machine, either the App won't install or it installed but doesn't run with "application is not installed" error. In debug mode the app works fine with the temporary certificate.
I checked the App with jarsigner and it has CertPath not validated: null errors.
I have also set the Manifest parameter debuggable and test only to false.
With the keytool I use the following command line -:
keytool -genkey -v -keystore vgpad.keystore -alias alias_name -sigalg SHA1withDSA -keyalg DSA -keysize 1024 -validity 10000
then for the Jarsigner
jarsigner -keystore D:\dev\Java\jdk1.7.0_02\bin\vgpad.keystore -sigalg SHA1withDSA -digestalg SHA1 -storepass puffin -keypass puffin V-G-Pad.apk alias_name
I have used various different options and also tried from Eclipse, export signed app... still the same error. Any help would be welcome, thanks.
Manifest must contain the minsdk version and maxsdkversion
There is another way to sign up the application.
Right Click on Project -->Select "Android Tools" Option --> "Export Signed Application Package"
in that select project --> create new .keystore file validity(years) = 50
later install that signed apk by using
command prompt from your device with following command
adb install yoursignedapk.apk
this signed apk will successfully install on your device
In fact I solved this using two actions,
resorting to the Java 1.6.0.30 JDK, I was using the 1.7 before, this solved the key and signing issues.
Ensured in the manifest I had only the android.permission.WRITE_EXTERNAL_STORAGE once, before the application tag
This was after using the adb logcat command to see the lancher issues :
Permission Denial: starting Intent {.... } requires
android.permission.WRITE_EXTERNAL_STORAGE
I developed a Android App and could sign it with the Eclipse Plugin, but i wanted to sign it manually with jarsigner and zipalign, so that i can choose the algorithm and the keysize by my self.
I created a Keystore with this command:
keytool -genkey -v -keystore keystore_name -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
My first issue is that i cant enter the Keystore with the Eclipse Plugin. It says:
Keystore was tampered with, or password was incorrect
So i went on with the jarsigner like this:
jarsigner -verbose -keystore keystore_name my_application.apk alias_name
and it works fine.
finally i run the tool zipaling:
zipalign -v 4 inputfile.apk outputfile.apk
I could publish my app in the market without any trouble. But when a friend downloaded my app, he gets the error: Package file was not signed correctly
Furthermore I can't install my app signed manually. But the version, signed with the Eclipse plugin works fine.
The big problem now I have is, that I can't upload the new apk file do the market, because it says that it is signed with an other certificate.
What can I do ?
Not sure if this will help but I came across a similar issue before. After trying a few things I used jarsigner like this and it has been working fine:
jarsigner -verbose -digestalg SHA1 -sigalg MD5withRSA -keystore %path to key store here% -signedjar %the name you want for your signed apk here% %the apk you want to sign here% your.keystore
EDIT:
Just noticed your question was about what to do with the app on the market place. I'm no help there. Sorry.
Verify the keytool you are using:
which keytool
check if it is set to openjdk... Android supports only Sun/Oracle Java as the keytool.