Hi, i’m starting to use ionic appflow to use the native build, i create a .apk but after the splash screen shows a white screen for sometime (about one minute) then shows the initial page of the app, i had this issue when i used to build the .apk on my machine but it solves using --prod --release. Does anyone knows how to solve this when using the native build for android from ionic appflow? I’m using the release version.
AppFlow runs npm run build
, that runs the script called “build” in your package.json. It doesn’t have --prod nor --release as default, so you’ll have to add it. (–release probably not as I think that’s for Cordova and it’s run anyways)
thank you, but how i add these to my package.json? I never did that, i’ve always used the command, its just “build”: “ionic-app-scripts build --prod --release” in the scripts at package.json?
yes, just edit the text, but remove --release as that’s a cordova command and will probably make the build command fail.
I add the command but give me a error on appflow
[17:53:25]: $ npm run build
[17:53:25]: ▸ > CadastralSPW@0.0.1 build /builds/project-0
[17:53:25]: ▸ > ionic-app-scripts build --prod
[17:53:26]: ▸ [17:53:26] ionic-app-scripts 3.2.4
[17:53:26]: ▸ [17:53:26] build prod started …
[17:53:26]: ▸ [17:53:26] clean started …
[17:53:26]: ▸ [17:53:26] clean finished in 1 ms
[17:53:26]: ▸ [17:53:26] copy started …
[17:53:26]: ▸ [17:53:26] deeplinks started …
[17:53:26]: ▸ [17:53:26] deeplinks finished in 269 ms
[17:53:26]: ▸ [17:53:26] ngc started …
[17:53:38]: ▸ [17:53:38] typescript error
[17:53:38]: ▸ Cannot find type definition file for ‘@types’.
[17:53:38]: ▸ [17:53:38] ionic-app-script task: “build”
[17:53:38]: ▸ [17:53:38] Error: Failed to transpile TypeScript
[17:53:38]: ▸ Error: Failed to transpile TypeScript
[17:53:38]: ▸ at errorCheckProgram (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:119:39)
[17:53:38]: ▸ at Object. (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:89:21)
[17:53:38]: ▸ at step (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
[17:53:38]: ▸ at Object.next (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
[17:53:38]: ▸ at fulfilled (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
[17:53:38]: ▸ npm ERR! code ELIFECYCLE
[17:53:38]: ▸ npm ERR! errno 1
[17:53:38]: ▸ npm ERR! CadastralSPW@0.0.1 build: ionic-app-scripts build --prod
[17:53:38]: ▸ npm ERR! Exit status 1
[17:53:38]: ▸ npm ERR!
[17:53:38]: ▸ npm ERR! Failed at the CadastralSPW@0.0.1 build script.
[17:53:38]: ▸ npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[17:53:38]: ▸ npm ERR! A complete log of this run can be found in:
[17:53:38]: ▸ npm ERR! /root/.npm/_logs/2019-07-19T17_53_38_266Z-debug.log
±-----------------±----------------------+
| Lane Context |
±-----------------±----------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | android |
| LANE_NAME | android package_build |
| PROJECT_WEB_DIR | www |
±-----------------±----------------------+
[17:53:38]: Exit status of command ‘npm run build’ was 1 instead of 0.
CadastralSPW@0.0.1 build /builds/project-0
ionic-app-scripts build --prod
[17:53:26] ionic-app-scripts 3.2.4
[17:53:26] build prod started …
[17:53:26] clean started …
[17:53:26] clean finished in 1 ms
[17:53:26] copy started …
[17:53:26] deeplinks started …
[17:53:26] deeplinks finished in 269 ms
[17:53:26] ngc started …
[17:53:38] typescript error
Cannot find type definition file for ‘@types’.
[17:53:38] ionic-app-script task: “build”
[17:53:38] Error: Failed to transpile TypeScript
Error: Failed to transpile TypeScript
at errorCheckProgram (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:119:39)
at Object. (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:89:21)
at step (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
at Object.next (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
at fulfilled (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CadastralSPW@0.0.1 build: ionic-app-scripts build --prod
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CadastralSPW@0.0.1 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! /root/.npm/_logs/2019-07-19T17_53_38_266Z-debug.log
±-----±--------------------±------------+
| fastlane summary |
±-----±--------------------±------------+
| Step | Action | Time (in s) |
±-----±--------------------±------------+
| 1 | default_platform | 0 |
| 2 | build_summary | 1 |
| 3 | add_git_credentials | 0 |
| 4 | detect_native_type | 0 |
| 5 | get_web_dir | 0 |
| 6 | modify_config_xml | 0 |
| | build_pro_app | 30 |
±-----±--------------------±------------+
[17:53:38]: fastlane finished with errors
/usr/local/bin/fastlane: [!] Exit status of command ‘npm run build’ was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
CadastralSPW@0.0.1 build /builds/project-0
ionic-app-scripts build --prod
[17:53:26] ionic-app-scripts 3.2.4
[17:53:26] build prod started …
[17:53:26] clean started …
[17:53:26] clean finished in 1 ms
[17:53:26] copy started …
[17:53:26] deeplinks started …
[17:53:26] deeplinks finished in 269 ms
[17:53:26] ngc started …
[17:53:38] typescript error
Cannot find type definition file for ‘@types’.
[17:53:38] ionic-app-script task: “build”
[17:53:38] Error: Failed to transpile TypeScript
Error: Failed to transpile TypeScript
at errorCheckProgram (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:119:39)
at Object. (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:89:21)
at step (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
at Object.next (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
at fulfilled (/builds/project-0/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CadastralSPW@0.0.1 build: ionic-app-scripts build --prod
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CadastralSPW@0.0.1 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! /root/.npm/_logs/2019-07-19T17_53_38_266Z-debug.log
Running after script…
$ run “clean-up”
ERROR: Job failed: command terminated with exit code 1
Do you know what might be?
whats is strange is that i don’t get this error when doing the npm run build on my machine, it works fine, Thank you