Parsing error trying to install apk file


#1

I wrote a very small app and connected to Ionic Services. It run perfectly on my browser (with ionic serve).
Added platform android. Then I built with Ionic Package to android and get the apk back. When I try to install in an android physical device (version 4.1.1) it gives parse error (“There is a problem parsing the package”).
On the phone, security, apps from unknown sources are allowed.
In the files AndroidManifest.xml, platforms.json and project.properties I set the target to api 16 and installed the crosswalk plugin recommended for old android versions, but still get the same error.
Is there anything else I can do to get my app installed and running on my version 4.1.1 device? Thanks in advance.


#2

Where do you build? On Mac or on windows? Try to run directly with ionic run android and see what happens… Maybe it’s a signing problem?


#3

Thanks for your attention.
I built with ionic package:

ionic package build android

and then download the apk file.

Using Jarsigner, I verified the apk that package returns is signed for debug, so it should install.


#4

Try this guide: http://ionicframework.com/docs/guide/publishing.html


#5

Thanks for the link. I have already visited it. It is useful when you are ready sign and to release the app.
When I use IONIC PACKAGE BUILD ANDROID the apk generated comes signed for debug, as verified with the tool JARSIGNER. So It does not seem to be a signing issue, but a version related one.


#6

Are you using Crosswalk? It can generate two apk’s, intended for different processor instruction sets. You can get installation issues if you try to install an apk with the wrong instruction set. If you aren’t using Crosswalk, you might want to add it to your project, make sure the apk produced does install, and then you can work on getting a working apk without Crosswalk.


#7

I added crosswalk plugin

cordova plugin add cordova-plugin-crosswalk-webview

that is all I did with crosswalk. It seems I must do something else, because when I build I only get one apk of the same size as before (aprox. 5 MB).


#8

They should look more or less like: android-armv7-release.apk and android-x86-release.apk. They are in

platforms/android/build/outputs/apk/

Use: ionic plugin add cordova-plugin-crosswalk-webview


#9

I am building with the PACKAGE tool from Ionic Service. I do not have android/build directory.
Now I am not sure if PACKAGE is including crosswalk in the building process because the apk it returns comes with 5 MB in size. Is there anything else I must do inside my source files after installing the crosswalk plugin?


#10

I don’t know anything about Package, but Crosswalk adds about 20mb to your app, so it’s not included. Do you have access to the Ionic CLI? You only used Cordova to install Crosswalk, which probably isn’t good enough.


#11

Package is one tool from the Ionic Cloud Services used to build apps.
Yes I use the Ionic CLI.
Just in case, I remove the plugin and re-installed with Ionic.

Now the build process with Package just failed (twice).


#12

If you use crosswalk, the apk should be big, at least 20/22 MB in size.


#13

did you find what the issue was? same problem here