--prod version android-debug.apk for release?

Hello,

I can confirm --prod version android-debug.apk doesn’t have long white loading screen issue.
It goes directly to Ionic app page after showing a gray screen for 2 seconds.

Is production version of app suitable for publishing on Google Play store?
I found this version can’t be signed and zipped (zipalign).

I want to reduce loading time of ionic app very much. --release build apk files all have this issue and I think this prevents me from building a real, professional app.

Is there anyone using --prod version for final release on play store? is that even possible?

Thanks,

Let’s summarize it like this, --prod is a must for production in my point of view

To release to the play store you have to build your app like following:

ionic cordova build android --prod --release

--prod apply on the bundle and gonna perform tricks to compress it, uglify it, minify it etc.
--release is performed by cordova to sign your app aka your app have to be signed in order to be published in the play store

5 Likes

Thanks for clarifying this!

I couldn’t find --prod --release command on Ionic doc page…
Now I see I have to use both of them.

No worries…it took me a while to find it too, since then, I typed it at least 100’000 times (at least), I am kind of use to it now :wink:

1 Like

Yeah… it’s so weird to not be able to find this command on Ionic doc page. It has --release command only. I think Ionic team should fix this…
http://ionicframework.com/docs/v1/guide/publishing.html

–prod is the only way to get rid of long loading screen issue but it can’t be used alone for publishing an app.

Well first of all, that’s documentation for version 1. If you are using >= 2, then https://ionicframework.com/docs/

You will find some documentation about --prod in Ionic App Script README https://github.com/ionic-team/ionic-app-scripts

The documentation for the CLI (commands) could be found in the README of the project https://github.com/ionic-team/ionic-cli

Or more easy with the cmd line

just type

ionic

give (with 3.18.0 for example)

Usage:

$ ionic <command> [<args>] [--help] [--verbose] [--quiet] [--no-interactive] [--confirm] [options]

Global Commands:

config <subcommand> ...... Manage CLI and project config values (subcommands: get, set)
docs ..................... Open the Ionic documentation website
info ..................... Print system/environment info
login .................... Login with your Ionic ID
signup ................... Create an Ionic account
ssh <subcommand> ......... Commands for configuring SSH keys (subcommands: add, delete, generate, list, setup, use)
start .................... Create a new project
telemetry ................ (deprecated) Opt in and out of telemetry

Project Commands:

build .................... Build web assets and prepare your app for any platform targets
cordova <subcommand> ..... Cordova functionality (subcommands: build, compile, emulate, platform, plugin, prepare, 
                           requirements, resources, run)
doctor <subcommand> ...... Commands for checking the health of your Ionic project (subcommands: check, ignore, list)
generate ................. Generate pipes, components, pages, directives, providers, and tabs (ionic-angular >= 
                           3.0.0) (alias: g)
git <subcommand> ......... Commands relating to git (subcommands: remote)
integrations <subcommand>  Add or disable various integrations in your app (subcommands: disable, enable)
link ..................... Connect your local app to Ionic
monitoring <subcommand> .. Commands relating to Ionic Pro error monitoring (subcommands: syncmaps)
serve .................... Start a local dev server for app dev/testing

and if you type

ionic cordova

you will get

ionic cordova - Cordova functionality

These commands integrate with Apache Cordova, which brings native functionality to your app. Aside from ionic 
cordova resources, these commands all wrap the Cordova CLI.

Cordova Reference documentation:
- Overview: https://cordova.apache.org/docs/en/latest/guide/overview/index.html
- CLI documentation: https://cordova.apache.org/docs/en/latest/reference/cordova-cli/

Usage:

$ ionic cordova <command> [<args>] [--help] [--verbose] [--quiet] [--no-interactive] [--confirm] [options]

Project Commands:

build .................... Build (prepare + compile) an Ionic project for a given platform
compile .................. Compile native platform code
emulate .................. Emulate an Ionic project on a simulator or emulator
platform ................. Manage Cordova platform targets (alias: platforms)
plugin ................... Manage Cordova plugins (alias: plugins)
prepare .................. Copies assets to Cordova platforms, preparing them for native builds
requirements ............. Checks and print out all the requirements for platforms
resources ................ Automatically create icon and splash screen resources
run ...................... Run an Ionic project on a connected device

But you are right even there I didn’t find --release :wink:

1 Like

Hmmm…
I just tested --prod --release command on the app I built… which is a basic app with not much on it.
The white loading screen problem came back.

–prod command alone can eliminate that white loading screen entirely… and --prod --release brought that problem back.
Is there any fix on this?

So it appears --release will always cause that long splash screen problem while --prod apk file can’t be published by itself.

EVERYONE ATTENTION PLEASE:

I finally created android-release-unsigned.apk without white splash screen problem at all.

The command to create this perfect android-release-unsigned.apk is:

ionic cordova build android --release --prod

I tried ionic cordova build android --prod --release… and it made the same apk as one made with just --release command. It showed me that long splashscreen for 5 seconds when it starts.

So you guys can try: --release --prod to eliminate that loading screen problem.
I hope someday this error gets permanently removed from Cordova by some talented people who can change that.

@reedrichards, yes, I’m testing on a real HTC android phone now. --release --prod works… it completely eliminates white splash screen just like --prod and it produces apk which can be published on play store.

2 Likes

Sounds crazy weird

I’ve to go afk, good to hear you found a solution!

Would be cool if someone would explain that…

1 Like

Yes… it’s weird. I changed its order and works just fine…

Thanks for all!

However this apk file built with --release --prod shows the same 2 second long gray screen when it starts just like all other apps built with Ionic. It would be nice to find a solution to that as well. Other apps built with Java or C# don’t have this problem… they may show a blank page for 1 second when they start.

Just in case, this is my setting on config.xml. I no longer get any splash screen at all besides 2 second long gray empty screen when I start my app.

<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="0" />
<preference name="ShowSplashScreen" value="false" />

Now I see custom made animated HTML page with SVG files when I start my app… which is very ideal and more realistic. I’m working on removing short gray page loading error now…

As far as I reckon, when I played with custom boot time, my conclusion was that the splash screen is mandatory because on iOS or Android (don’t remember which one) I was facing a blank before the load screen, which is actually what you are trying to do if I understand correctly. Therefore, if you find a solution, I would be really curious and would like to hear about it :wink:

1 Like

Could you file an issue on this? https://github.com/ionic-team/ionic-cli/issues

1 Like

Yes, I would like to do that. The real bug is still the gray screen which shows up for 2 seconds when an Ionic app starts.
This should be erased or replaced with HTML5 & CSS3 page to make ionic apps look normal.