ionic build ios command not working - ionic-framework

I have walked through the tutorial instructions to set up cordova and ionic. I can successfully run the app in development but get this error when building ios. Any ideas? Tried updating node and cordova.
sudo ionic build ios
Running 'build:before' gulp task before build
[11:16:00] Starting 'clean'...
[11:16:00] Finished 'clean' after 47 ms
[11:16:00] Starting 'build'...
[11:16:00] Starting 'sass'...
[11:16:00] Starting 'html'...
[11:16:00] Starting 'fonts'...
[11:16:00] Starting 'scripts'...
[11:16:00] Finished 'scripts' after 45 ms
[11:16:00] Finished 'html' after 51 ms
[11:16:00] Finished 'fonts' after 54 ms
[11:16:00] Finished 'sass' after 770 ms
[11:16:07] Finished 'build' after 7.18 s
[11:16:07] Starting 'build:before'...
[11:16:07] Finished 'build:before' after 11 μs
• You're trying to build for ios but don't have the platform installed yet.
∆ Installing ios for you.
Installing cordova-plugin-device
Installing cordova-plugin-console
Installing cordova-plugin-whitelist
Installing cordova-plugin-splashscreen
Installing cordova-plugin-statusbar
Installing ionic-plugin-keyboard
Error: Command failed: /bin/sh -c cordova platform add ios
Error: Platform ios already added.
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:821:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:4
69:12)

First of all, it seems you have some issues on ios platform installation, try removing it and adding it back to your development space.
Run command ionic platform remove ios && ionic platform add ios before trying to build for ios.
Second, you need Mac Operating system to build ios apps, as it has dependencies on XCode (A native software) to build.
Third, if you still have the same iussue, then it could be due to a bug discribed here. https://github.com/driftyco/ionic-cli/issues/772
Try sudo npm install -g cordova and rerun the build.
Good luck.

Related

Ionic won't build if --prod specificed

I wanted to build out the web version of my application and fired off the Ionic build --prod command after adding the browser platform.
My Output:
> ionic build --prod
Running app-scripts build: --prod
[09:32:57] build prod started ...
[09:32:57] clean started ...
[09:32:57] clean finished in 58 ms
[09:32:57] copy started ...
[09:32:58] deeplinks started ...
[09:32:58] deeplinks finished in 164 ms
[09:32:58] ngc started ...
[09:33:14] ngc finished in 16.15 s
[09:33:14] preprocess started ...
[09:33:14] preprocess finished in 4 ms
[09:33:14] webpack started ...
[09:33:14] copy finished in 16.98 s
I've let the process sit for at least an hour, but it never progresses. I don't get any error messages, but it never progresses. Any idea how I can get the project to build?
I'm using Ionic CLI 3.20.0 and Angular 5.2.10.
To run or build you have to use
ionic cordova run android --prod --release
or
ionic cordova build android --prod --release
and please refer to the documentation also https://ionicframework.com/docs/intro/deploying/

Ionic 3 App is not run on Android device

I can't run app on Android device it is not giving any error. Here is the output of terminal;
Running app-scripts build: --platform android --target cordova
[13:00:25] build dev started ...
[13:00:25] clean started ...
[13:00:25] clean finished in 24 ms
[13:00:25] copy started ...
[13:00:25] deeplinks started ...
[13:00:25] deeplinks finished in 130 ms
[13:00:25] transpile started ...
[13:00:31] transpile finished in 5.76 s
[13:00:31] preprocess started ...
[13:00:31] preprocess finished in 1 ms
[13:00:31] webpack started ...
[13:00:31] copy finished in 6.35 s
[13:00:41] webpack finished in 10.48 s
[13:00:41] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[13:00:44] sass finished in 2.45 s
[13:00:44] postprocess started ...
[13:00:44] postprocess finished in 19 ms
[13:00:44] lint started ...
[13:00:44] build dev finished in 19.37 s
> cordova run android
Android Studio project detected
ANDROID_HOME=C:\Users\umutg\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk-10
(node:3684) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Requirements check failed for JDK 1.8 or greater
(node:3684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
I think It does not see device, It does not work on another device or emulator. I create new app for trying it's same.
It's about JDK V 10, I uninstalled it and works fine.

ionic serve not open the browser

In the project, ionic serve show:
vega#vega-linux:/opt/projetos/myPorject$ ionic serve
> ionic-hello-world# ionic:serve /opt/projetos/myPorject
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
keywords if/then/else require v5 option
[16:28:19] ionic-app-scripts 0.0.47
[16:28:20] watch started ...
[16:28:20] build dev started ...
[16:28:20] clean started ...
[16:28:20] clean finished in 6 ms
[16:28:20] copy started ...
[16:28:20] transpile started ...
[16:28:22] transpile finished in 2.91 s
[16:28:22] webpack started ...
[16:28:23] copy finished in 3.06 s
[16:28:30] webpack finished in 7.81 s
[16:28:30] sass started ...
[16:28:32] sass finished in 1.42 s
[16:28:32] build dev finished in 12.18 s
[16:28:32] watch ready in 12.25 s
[16:28:32] dev server running: http://localhost:8100/
And the browser not open.
My system
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.4.0
Xcode version: Not installed
Why the ionic serve don't show ionic $?
In ionic 1 show:
vega#vega-linux:/opt/projetos/teste$ ionic serve
Running live reload server: http://192.168.2.103:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server: http://192.168.2.103:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $
But not in ionic2.
try this code
ionic serve --address=localhost
First try this command line:
npm run ionic:serve
and if does't help try the second one:
npm install --save-dev #ionic/app-scripts#latest
then
ionic serve

ionic serve command fails with "build dev failed: Cannot find module '../util/Logger'"

I create and run an ionic project using
ionic start test1 blank --v2
cd test1
ionic serve
And I get:
[13:48:30] ionic-app-scripts 0.0.42
[13:48:30] watch started ...
[13:48:30] build dev started ...
[13:48:30] clean started ...
[13:48:30] clean finished in 1 ms
[13:48:30] copy started ...
[13:48:30] transpile started ...
[13:48:34] transpile finished in 4.04 s
[13:48:34] webpack started ...
[13:48:34] build dev failed: Cannot find module '../util/Logger'
[13:48:35] copy finished in 4.13 s
[13:48:35] watch ready in 4.14 s
I tried to remove the node-modules directory and make "npm install" to rebuild the modules, but with the same result. (even reinstalled ionic framefork)
I have a Linux Mint 18.

Add android platform on ionic

Hello i get the project from http://reactorapps.io/blog/wordpress-api-ionic-app/
now i want add android platfrom , when i use ionic platform add android
i get this error :
D:\downloadionic\reactorApp\reactorApp>ionic platform add android
✗ (node:9956) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Updated the hooks directory to have execute permissions
(node:1316) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Creating android project...
C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:126
throw e;
^
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
at C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib\check_reqs.js:174:19
at _fulfilled (C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:760:13)
at C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:574:44
at flush (C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Error: C:\Users\Pouria.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\create.bat: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\Pouria\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
what i must to do ???
You have to install Android KitKat (4.4.2) (API 19) through the Android SDK Manager.
You can do this by installing Android Studio and accessing the SDK Manager from within it.
Select the packages that you need and hit 'Install'.