Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Build apk with Phonegap Cli

I Build a apk with phonegap cli, but problem is when I try to install apk with android phone get a Parse Error "There is a problem parsing the package"

What I try to build apk

1)phonegap create my-app com.example.myapp my-app

2)phonegap platform add android

at path /path/to/myproject/platforms/android/cordova run command build --release

I get apk at path/myapp/platforms/android/build/outputs/apk/android-release-unsigned.apk

I tried to install this apk to my phone get error Parse Error "There is a problem parsing the package"

As I search over net this may be problem with sign/key, I found some solutions

first command not work keytool -genkey -v -keystore [keystore_name].keystore -alias [alias_name] -keyalg RSA -keysize 2048 -validity 10000 get error

'keytool' is not recognized as an internal or external command,
operable program or batch file.

Secondly this is for online phone build but I need to create apk with cli.

This also does not suit to me.

Can anyone help me to resolve this issue Thanks in advance for help.

like image 461
Dinesh Avatar asked Mar 19 '16 15:03

Dinesh


1 Answers

If your using the CLI for dev purposes just use phonegap build android --debug --device. Your don't need to worry about any signing identity issues this way. For release builds use the other method you were using build --release. After a release build you need to sign the android-release-unsigned.apk before it can be put on a device.

https://developer.android.com/tools/publishing/app-signing.html

like image 130
johnborges Avatar answered Sep 20 '22 04:09

johnborges