Signing a package or generating a signed package `cordova build release`


#1

Hello,

I’m wanting to build my app (ionic 2) for release (Android), but can’t find how to sign a package. I’m running cordova build android --release to build my package but this generates an unsigned package.

Is there a guide to building keys and generating a signed Android package. I’m pretty new to all this so sorry if it’s an obvious one.

Thanks a lot


#2

Follow this guide: How to automatically sign android applications with the Ionic CLI

Or this guide: https://ionicframework.com/docs/intro/deploying/


#3

Hi LolStats,

Looks like you’re using ionic build android --release to build you app, when I run ionic build android --release I get the message:

The build command has been renamed. To find out more, run:

  ionic cordova build --help

When I run ionic cordova build android --release I get the error:

Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[17:45:34]  build dev started ... 
Error: tsconfig: Cannot read file '/*projectdir*/platforms/android/tsconfig.json': ENOENT: no such file or directory, open '/*projectdir*/platforms/android/tsconfig.json'

If I copy the tsconfig file from my project root into the Android directory I get another error:

Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[17:43:01]  build dev started ... 
[17:43:01]  typescript error 
            No inputs were found in config file 
            '/home/james/Projects/retro-achievements-app/platforms/android/tsconfig.json'. Specified 'include' paths 
            were '["src/**/*.ts"]' and 'exclude' paths were '["node_modules"]'. 

TypeError: Cannot read property 'replace' of null

Which version of Ionic CLI are you using? I have 3.0.0 installed


#4

Just remove the Android platform and add it back again to regenerate your Android project, faster than to debug ost of the time…