-
Notifications
You must be signed in to change notification settings - Fork 311
Cant build android app with --prod anymore #1243
Comments
As a temporary workaround you can run the Ionic build commands manually instead of letting Ionic deal with everything.
|
Hi @stevengunneweg and @jjacobs33589, How do I recreate the issue? Can someone upload a sample project? Thanks, |
@danbucholtz I was just checking to see which process fails exactly but did this in a different project than before and oddly enough it did succeed (though it did take a while, 81.15 seconds to be precise and the node process takes up almost 100% cpu). In the other project running I'm not sure what the difference is between the two projects but I will try to find it. |
Same problem even with workaround suggested by @stevengunneweg.
I should have the latests packages:
|
I had the same problem first on Mac and @stevengunneweg tip didn't help either. Then I executed 'ionic cordova run ios' which worked, then I tried the same command with --prod tag and it worked too and then I tried 'ionic cordova build ios --prod' again and this time it surprisingly worked. |
I ended up downgrading app-scripts from 2.1.4 to 2.1.3 |
it works when you delete .sourcemaps in root of project. hope this can help |
I'm having a similar issues, but for me it fails because it cannot find some file:
|
Hello, This should be resolved in To test, please run:
Thanks, |
I had the same problem here and now it works again. Thank you. |
This issue is still open with app-scripts 3.1.6 command is: ionic cordova build android --prod --release i really didn't do anything special, it worked over 1 1/2 years now, since upgrade to latest the problem is there... but with only --prod it is not, so there must be a difference somewhere... |
same problem here - in my case the plugin https://ionicframework.com/docs/native/in-app-purchase-2/ goes bonkers with --prod (but works with the command line in @nickwinger comment). I noticed that it works if I use --livereload (to the run command instead of build) |
Also having the same exact issue as @nickwinger above, but with app-scripts 3.1.8. Workaround still works |
Having the same problem as described from @nickwinger with latest CLI 3.1.9 |
Steps to reproduce: 1.nvm use 8.9.0/8.9.4/9.0.0/10.0.0 rampage@rampage-ThinkStation-D20:~/Desktop/work/repos/private/fresh-request/client$ ionic cordova build android --release --aot true --environment prod --output-hashing all --sourcemaps false --extract-css true --named-chunks false --build-optimizer true
> npm run ionic:build -- --aot --platform android
> [email protected] ionic:build /home/rampage/Desktop/work/repos/private/fresh-request/client
> ionic-app-scripts build --prod --aot "--aot" "--platform" "android"
[12:22:06] ionic-app-scripts 3.1.6
[12:22:06] build prod started ...
[12:22:06] clean started ...
[12:22:06] clean finished in 1 ms
[12:22:06] copy started ...
[12:22:06] deeplinks started ...
[12:22:07] deeplinks finished in 203 ms
[12:22:07] ngc started ...
[12:22:20] ngc finished in 13.71 s
[12:22:20] preprocess started ...
[12:22:20] preprocess finished in less than 1 ms
[12:22:20] webpack started ...
[12:22:21] copy finished in 14.23 s
<--- Last few GCs --->
[15652:0x3b24460] 107519 ms: Mark-sweep 1401.6 (1451.0) -> 1401.6 (1459.0) MB, 1256.3 / 0.0 ms allocation failure GC
in old space requested
[15652:0x3b24460] 108930 ms: Mark-sweep 1401.6 (1459.0) -> 1401.6 (1447.0) MB, 1409.9 / 0.0 ms last resort GC in old
space requested
[15652:0x3b24460] 110334 ms: Mark-sweep 1401.6 (1447.0) -> 1401.6 (1446.5) MB, 1404.5 / 0.0 ms last resort GC in old
space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x124b0dfa5ee1 <JSObject>
1: isOptionalParameter(aka isOptionalParameter)
[/home/rampage/Desktop/work/repos/private/fresh-request/client/node_modules/typescript/lib/typescript.js:~29475]
[pc=0x293af2ebb4ee](this=0x263c5ce02311 <undefined>,node=0x1bd6b8d67131 <NodeObject map = 0x3c2810835479>)
2: symbolToParameterDeclaration(aka symbolToParameterDeclaration)
[/home/rampage/Desktop/work/repos/private/fresh-request/...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x121a2cc [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewStruct(v8::internal::InstanceType) [node]
6: v8::internal::Factory::NewTuple3(v8::internal::Handle<v8::internal::Object>,
v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
7: v8::internal::LoadIC::LoadFullChain(v8::internal::Handle<v8::internal::Map>,
v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>,
v8::internal::Handle<v8::internal::Smi>) [node]
8: v8::internal::LoadIC::UpdateCaches(v8::internal::LookupIterator*) [node]
9: v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>)
[node]
10: v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [node]
11: 0x293af270463d
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] ionic:build: `ionic-app-scripts build --prod --aot "--aot" "--platform" "android"`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/rampage/.npm/_logs/2018-05-05T09_23_57_331Z-debug.log
[ERROR] An error occurred while running npm run ionic:build -- --aot --platform android (exit code 134) Ionic Info cli packages: (/home/rampage/.nvm/versions/node/v8.9.4/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.9
Cordova Platforms : android 7.1.0
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 6.0.0
OS : Linux 4.15
Environment Variables:
ANDROID_HOME : /mnt/5ff78921-fcbf-40b3-b005-1705ed0bfe2c/Android
Misc:
backend : pro
|
from 1426, you can run the following :
Instead (careful with the environment variables though) |
When i "ionic cordova build android" ionic v4 then this error displayed. so any solution please? Failed to execute aapt FAILURE: Build failed with an exception.
BUILD FAILED in 1s |
Been struggling with my Ionic3 to build with an --aot flag for months now...Thank you! |
use this command to build .apk
- ionic cordova build android
i hope it will useful for you.
…On Wed, Oct 31, 2018 at 10:24 AM Neil ***@***.***> wrote:
This issue is still open with app-scripts 3.1.6
When i do --prod it hangs at:
[11:40:19] webpack started ...
[11:40:21] copy finished in 22.04 s
then it just hangs...
command is: ionic cordova build android --prod --release
i really didn't do anything special, it worked over 1 1/2 years now, since
upgrade to latest the problem is there...
acutally this is working:
ionic cordova build android --release --aot true --environment prod
--output-hashing all --sourcemaps false --extract-css true --named-chunks
false --build-optimizer true
but with only --prod it is not, so there must be a difference somewhere...
Been struggling with my Ionic3 to build with an --aot flag for months
now...Thank you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1243 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Akroz5WlNK8mIKGkH-Ix7efYcjwRi3Cxks5uqS0AgaJpZM4Pk7qn>
.
|
I have the same problema and when I use this:
the build is finished, but i can't install the app:
If i run ionic cordova run android --prod it happens:
|
I realized that the problem happens when I import AngularFireDatabaseModule to app.module.ts
and
|
Thank You! Thank You so much! Can we ask you how do you understand that you have to put all those arguments! We fall in research for few days and it was no luck till we find your solution! Thank You again! If it gonna help someone we get it to work properly with ionic-app-scripts 3.2.1! Now we have our app that opening in 4-6 sec and before that trick it was 22-25 sec (for more then 70 pages in project)! |
I know this is old, but I just started to have this problem too. I have tried older versions of code and it still happen so it made me think it has to be something with a plugin. (We share node_modules between apps, but each app has its own plugins folder). Haven't tried to push to production. |
I had tried a similar command before. Maybe wasn't running it correctly. But after I ran this. export NODE_OPTIONS=--max_old_space_size=4096 |
removing "ionic_source_map_type": "#inline-source-map" fixed the problem for me |
can confirm issue still persist. when I run |
Short description of the problem:
I can build my ionic 3 app with --prod anymore. the build process starts but then stops and exits on the step 'postprocess started'
Steps to reproduce:
1.npm update
2.ionic cordova build android --prod
Which @ionic/app-scripts version are you using?
I'm using app-scripts 2.1.4
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
`$ ionic cordova build android --prod --release -- --buildConfig=build.json
[INFO] Running app-scripts build: --prod --platform android --target cordova
[12:03:05] build prod started ...
[12:03:05] clean started ...
[12:03:05] clean finished in 100 ms
[12:03:05] copy started ...
[12:03:05] ngc started ...
[12:03:53] ngc finished in 48.27 s
[12:03:53] preprocess started ...
[12:03:53] deeplinks started ...
[12:04:03] deeplinks finished in 9.71 s
[12:04:03] optimization started ...
[12:04:05] copy finished in 60.17 s
[12:04:50] optimization finished in 47.05 s
[12:04:50] preprocess finished in 56.76 s
[12:04:50] webpack started ...
[12:06:04] webpack finished in 74.17 s
[12:06:04] sass started ...
[12:06:04] uglifyjs started ...
[12:06:07] sass finished in 2.99 s
[12:06:07] cleancss started ...
[12:06:12] cleancss finished in 4.56 s
[12:07:54] uglifyjs finished in 110.14 s
[12:07:54] postprocess started ...`
Issue is also here
https://forum.ionicframework.com/t/how-to-debug-app-scripts-postprocess-failing/106762
The text was updated successfully, but these errors were encountered: