Ionic Package - any new changes? (generates livereload)

Hello,

Since this evening it seems that running “ionic package build android --prod” generates something differently.
I have checked my code from yesterday but can’t find anything suspect regarding this new behaviour.

New behaviour:
After installing and running the finished APK the application tries to reach the IP-adress from where I did run “ionic package…”, it works and loads the app if “ionic serve” is running on my computer otherwise I get some NET_ERR…

Workaround until I figure this out:
I generate APK with Android Studio.

//Fredy

I would say the build that was done before ionic package was a livereload build - and somehow package didn’t do and upload its own build…

Can you please explain in more detail?

Run ionic package again and show us all output (and the command you run).
Also post your ionic info output please.

Here are some more info, I don’t know but it works again, the generated APK does not act as a livereload build.

Build 71 did act as a livereload build.
Build 74 did not and I am happy again :slight_smile:

-----This is what I did between the builds:-----

ionic package build android

ionic package build android --release --prod
[ERROR] Sorry–a valid production security profile is required for Android release builds.

(I generated and uploaded a keystore)
ionic package build android --release --prod

ionic cordova platform rm ios
ionic cordova platform rm android
ionic cordova platform add android

ionic cordova build android --prod
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android (exit code 1):

    ANDROID_HOME=/Users/*******/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
    Subproject Path: CordovaLib
    Error: spawn EACCES

ionic package build android --prod <---- started working again

--------END--------

Build 71:
ionic package build android --prod
Running app-scripts build: --prod

[22:20:45] build prod started …
[22:20:45] clean started …
[22:20:45] clean finished in 3 ms
[22:20:45] copy started …
[22:20:45] ngc started …
[22:20:49] ngc finished in 4.05 s
[22:20:49] preprocess started …
[22:20:49] deeplinks started …
[22:20:49] deeplinks finished in 151 ms
[22:20:49] optimization started …
[22:20:49] copy finished in 4.31 s
[22:20:56] optimization finished in 6.54 s
[22:20:56] preprocess finished in 6.70 s
[22:20:56] webpack started …
[22:21:00] webpack finished in 4.19 s
[22:21:00] sass started …
[22:21:00] uglifyjs started …
[22:21:01] sass finished in 731 ms
[22:21:01] cleancss started …
[22:21:01] cleancss finished in 646 ms
[22:21:06] uglifyjs finished in 6.62 s
[22:21:06] postprocess started …
[22:21:06] postprocess finished in 8 ms
[22:21:06] lint started …
[22:21:06] build prod finished in 21.58 s
:heavy_check_mark: Requesting snapshot upload - done!
⠧ Uploading snapshot (100.00%)
[22:21:08] lint finished in 1.45 s
:heavy_check_mark: Uploading snapshot - done!
[OK] Uploaded snapshot -*****--****!
:heavy_check_mark: Requesting project upload - done!
:heavy_check_mark: Uploading project - done!
:heavy_check_mark: Queuing build - done!
[OK] Build 71 has been submitted!

Build 74:
ionic package build android --prod
Running app-scripts build: --prod

[23:21:17] build prod started …
[23:21:17] clean started …
[23:21:17] clean finished in 1 ms
[23:21:17] copy started …
[23:21:17] ngc started …
[23:21:21] ngc finished in 3.94 s
[23:21:21] preprocess started …
[23:21:21] deeplinks started …
[23:21:21] deeplinks finished in 124 ms
[23:21:21] optimization started …
[23:21:21] copy finished in 4.16 s
[23:21:27] optimization finished in 6.17 s
[23:21:27] preprocess finished in 6.29 s
[23:21:27] webpack started …
[23:21:31] webpack finished in 4.11 s
[23:21:31] sass started …
[23:21:31] uglifyjs started …
[23:21:32] sass finished in 753 ms
[23:21:32] cleancss started …
[23:21:33] cleancss finished in 647 ms
[23:21:37] uglifyjs finished in 6.26 s
[23:21:37] postprocess started …
[23:21:37] postprocess finished in 7 ms
[23:21:37] lint started …
[23:21:37] build prod finished in 20.63 s
:heavy_check_mark: Requesting snapshot upload - done!
⠦ Uploading snapshot (100.00%)
[23:21:39] lint finished in 1.35 s
:heavy_check_mark: Uploading snapshot - done!
[OK] Uploaded snapshot -*****--****!
:heavy_check_mark: Requesting project upload - done!
:heavy_check_mark: Uploading project - done!
:heavy_check_mark: Queuing build - done!
[OK] Build 74 has been submitted!

1 Like

I think I found the “problem” in config.xml
(I have no idea how and why the file changed in the first place…)

Build 71: (Acts as livereload)
<content original-src="index.html" src="http://10.0.100.200:8100" />

Build 74: (Works as normal standalone)
<content src="index.html" />

This is changed when you start a livereload build locally.
Normally this gets replaced when you do a normal build again, as Ionic Package does.

But good you could pinpoint it. Will try to remember that for next time.

1 Like