7

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.

Emzor
  • 1,380
  • 17
  • 28
Dinesh
  • 835
  • 2
  • 17
  • 37

3 Answers3

10

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

johnborges
  • 2,422
  • 20
  • 33
0

keykool will work when invoke the cmd as administrator

Nayana_Das
  • 1,789
  • 4
  • 23
  • 48
0

If you just want the apk for testing, just use phonegap build --debug NOT "--release". This will do the job and install with no problem.