How to fix build failed issue in Ionic 3 for android? - ionic-framework

When I try ionic cordova build android --prod --release command in Ionic 3, it shows an error
[12:24:50] ionic-app-script task: “build”
[12:24:50] Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
at /Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:237:55
at step (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
at Object.next (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
at fulfilled (/Users/angelamal/Documents/osome/node_modules/#ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --prod --target cordova --platform android exited
with exit code 1.
While I try to build an android app in Ionic 3.
I used this command ionic cordova build android --prod --release
But it is showing an error. How to solve this?
Thanks in Advance

Related

Unable to build android apk file from ionic framework

I am new to IONIC. My problem is that I am trying to build an apk file using downloaded project. I getting an error. Attaching my logs for reference. Any help would be great
Using this command to build apk ionic cordova build android --prod --release
> ionic-v1.cmd build
[17:21:38] Invoking sass gulp task.
> cordova.cmd build android --release
Running command: node E:\Ionic Projets\zmNinja-master\hooks\before_prepare\02_jshint.js E:\Ionic Projets\zmNinja-master
cordova-custom-config: Skipping auto-restore of config file backup(s)
Running command: node E:\Ionic Projets\zmNinja-master\hooks\after_prepare\010_add_platform_class.js E:\Ionic Projets\zmNinja-master
Running command: node E:\Ionic Projets\zmNinja-master\hooks\after_prepare\020_remove_sass_from_platforms.js E:\Ionic Projets\zmNinja-master
Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.```

ionic cordova build android - Ionic Woocommerce app not build

Ionic cordova build error
Command
cordova build android
Gives output:
Android Studio project detected
ANDROID_HOME=C:\Users\Clide\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191
studio
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
[ERROR] An error occurred while running subprocess cordova.
cordova build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

ionic app error while building Android APK

I am getting the error while building the ionic app ,ionic-app-script is missing.How to add 'ionic-app-script' file in ionic 2 project? what is the purpose of this file?
just delete platform folder and run
ionic cordova build android --release --prod

Ionic ios failed build

I have problem when i bulid ios using ionic cordova build ios --release
how can i solve it , i am using macOS
Apple-User:alfraseh FirasHunaiti$ ionic cordova build ios --release
> ionic-app-scripts build --target cordova --platform ios
Error: spawn EACCES
at ChildProcess.spawn (internal/child_process.js:313:11)
at Object.exports.spawn (child_process.js:503:9)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/cross-spawn/index.js:17:18)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-framework/utils/shell.js:124:12)
at ShellCommand.spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-framework/utils/shell.js:113:16)
at ShellCommand.run
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-framework/utils/shell.js:80:24)
at Shell.<anonymous>
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/shell.js:32:37)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:107:75
at new Promise (<anonymous>)
Build the project for ios (Xcode) sudo ionic cordova prepare iOS or sudo ionic Cordova build ios then go to the platform folder in the project and open with xcode the one that I export to you, and from xcode compile the project.

ionic build --release --prod ios fails

ionic build --release --prod ios has begun failing intermitently and gives the following error:
Error: Error code 65 for command: xcodebuild with args: -xcconfig
Any ideas?
Ionic 2.2.1
Xcode 8
The following procedure worked for me:
deleted the node_module folder
NPM Install
ionic Serve
Stop server
ionic platform add ios
ionic build --release --prod ios