I have recently been trying to ionic labs view a try. From the docs, its as simple as the command ionic serve --lab . But this only shows the normal ionic serve view not android and iphone view . I do not see any errors.
$ ionic serve -l
> ionic-hello-world# ionic:serve /home/raj/ionic/bookemon
> ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
[12:10:35] ionic-app-scripts 1.0.0
[12:10:35] watch started ...
[12:10:35] build dev started ...
[12:10:35] clean started ...
[12:10:35] clean finished in 6 ms
[12:10:35] copy started ...
[12:10:35] transpile started ...
[12:10:39] transpile finished in 3.58 s
[12:10:39] webpack started ...
[12:10:39] copy finished in 3.74 s
[12:10:46] webpack finished in 6.89 s
[12:10:46] sass started ...
[12:10:47] sass finished in 719 ms
[12:10:47] build dev finished in 11.23 s
[12:10:47] watch ready in 11.31 s
[12:10:47] dev server running: http://localhost:8100/
This is my ionic info
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.6
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.2.1
Xcode version: Not installed
Not sure whats going on here. I tried reinstalling ionic and npm_modules but its not working. Any help? Thanks in advance.
Are you sure that you are opening http://localhost:8101/ionic-lab and NOT just http://localhost:8101 ?
Run ionic serve --lab or ionic serve -l
Goto http://localhost:8101/ionic-lab
Note
localhost:8101 loads the normal view and
localhost:8101/ionic-lab loads the view with options to various platform
"scripts": {
"build": "ionic-app-scripts build",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "watch",
"deploy:before": "build",
"build:before": "build",
"run:before": "watch"
}
In package.json change scripts to above and run ionic serve -l
i think ionic serve -l doesn't work since ionic 2 using
ionic-app-scripts.
while, them using ionic view app, for live test.
check here https://play.google.com/store/apps/details?id=com.ionic.viewapp&hl=en
Related
When I run ionic cordova build android –prod i get the error:
Downloading https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-7.1.1-all.zip failed: timeout
I'm behind a proxy, so I set
ionic config set -g proxy http://proxy-..***:9999
I have executed ionic start myApp tabs --cordova --type=angular
I have executed ionic serve
but i can't do the build
I will be very grateful if you can help me please.
Ionic:
Ionic CLI: 6.20.3
Ionic Framework: #ionic/angular 6.3.2
Cordova:
Cordova CLI: 11.0.0
Cordova Platforms: android 10.1.2
Utility:
cordova-res: not installed globally
native-run: not installed globally
System:
NodeJS: v16.17.0 (C:\Program Files\nodejs\node.exe)
npm: 8.15.0
OS: Windows 10
Make sure you already added android in your ionic app then proceed on these steps.
Download the gradle: https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Place the zip file inside: {YourAppName}/platforms/android/gradle
Set an environment variable in your OS: CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="../gradle-7.1.1-all.zip"
Run ionic cordova build android --prod
i was trying to use live reload on my ionic 2 application. so i found this command
ionic run browser --live-reload
is not working as expected and while making code changes i am receiving console messages
[16:12:47] build started ...
[16:12:47] transpile update started ...
[16:12:47] transpile update finished in 46 ms
[16:12:47] deeplinks update started ...
[16:12:47] deeplinks update finished in 248 ms
[16:12:47] webpack update started ...
but the page isn't reloading
i found the solution on the github page
include a script in the package.json file
"browser": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"
and run
npm run browser
When you run the command ionic cordova run browser --livereload you will see something like this in CLI:
[19:39:00] dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
External: http://192.168.0.51:8100
Just open http://192.168.0.51:8100 or http://localhost:8100 and your live reload will work on that address. Your browser might have opened in http://localhost:8000 instead of 8100
First off, should anyone need this answer, the command has been renamed in the later version to
ionic cordova run browser
Second, The --livereload flag is not supported when you run this command. this issue explains more
Try This
ionic cordova run browser --livereload --consolelogs --serverlogs
"serve": "npx ionic serve --cordova --platform browser"
Using this command browser will be reloaded automatically.
ionic serve
If you want to run application with different platform in browser you can use this command :
ionic serve -l
This both command will reload page automatically on code change
I have started a clean project with ionic2 based on tabs template, by following the next steps:
$ ionic start <myapp> --v2
$ cd <myapp>
$ ionic serve
Then the output from ionic serve is just:
> ionic-hello-world# ionic:serve /home/luan/<myapp>
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
If I try to open localhost:8100 there's no response.
The files and code of the project are just the same as one using tabs template, but it's just don't wonking.
Could someone help?
UPDATE:
My ionic info
My system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.2.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.10.0
Xcode version: Not installed
Have you tried using
npm run ionic:serve
I have found the answer. It turns out, the 1.2.2 version of Ionic App Scripts (app-scripts) version was the problem. Just downgraded to 1.1.4 and works fine. The actual workaround:
in package.json, change
"#ionic/app-scripts": "1.2.2"
to
"#ionic/app-scripts": "1.1.4"
then run npm install again. It should show something like this:
[...]
- sentence-case#2.1.1 node_modules/sentence-case
- change-case#3.0.1 node_modules/change-case
ionic-hello-world# /home/luan/Projetos/prestacontas
└── #ionic/app-scripts#1.1.4 ## The problem was here
Make shure that #ionic/app-scripts is now 1.1.4, and not 1.2.2.
And that's it.
Here is a solution for you,,, :)
Most probably this can be an issue of updating. Because I opened two of my ionic projects. one is from late 2017. For that project live reload is working without an issue. The problem with my new project. I checked the "ionic info" and found that both are same other than the ionic framework version. my older one is v 3.7.1. unfortunately, that version not installing now. don't know exactly what the problem is.
However, I found a solution,
instead of "Ionic serve" command run the following command for the first time. then you will not need to run "ionic serve" each time.
npm run ionic:serve
I had the same error when I updated Ionic. I worked around it by using:
ionic serve --address localhost
The above solution to use "#ionic/app-script": "1.2.2" works to have it use localhost instead of 0.0.0.0. However it created other errors that were easily fixed by following the addition warnings.
"devDependencies": {
"#ionic/app-scripts": "1.2.2",
The one new error I still couldn't pinpoint yet is:
Error Close Runtime Error timeStamp.getDate is not a function Stack
TypeError: timeStamp.getDate is not a function
at HomePage.timeSince (http://localhost:8100/build/main.js:70141:33)
at SafeSubscriber._next (http://localhost:8100/build/main.js:70088:42)
at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/main.js:69844:16)
at SafeSubscriber.next (http://localhost:8100/build/main.js:69793:22)
at Subscriber._next (http://localhost:8100/build/main.js:69746:26)
at Subscriber.next (http://localhost:8100/build/main.js:69710:18)
at XMLHttpRequest.onLoad (http://localhost:8100/build/main.js:44518:38)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:14051)
at Object.onInvokeTask (http://localhost:8100/build/main.js:27788:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:13987) Ionic Framework: 2.0.0-rc.2 Ionic Native: 2.2.3 Ionic App Scripts:
1.2.2 Angular Core: 2.1.1 Angular Compiler CLI: 2.1.1 Node: 6.9.1 OS Platform: Windows 10 Navigator Platform: Win32 User Agent: Mozilla/5.0
(Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/56.0.2924.87 Safari/537.36
The app does run but that window popped up on Chrome and I had to close it before I could see the output of the app.
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
Tried many times, the apk file size does not change.
ionic revert android;
ionic browser add crosswalk-lite
ionic build android
I also tried remove android platform and do from scratch, but never suceeded.
Your system information:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.8.11
Ionic CLI Version: 1.4.4
Ionic App Lib Version: 0.0.20
OS: Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS
Node Version: v0.12.3
Same here.
I guess crosswalk-lite is so new that ionic still doesn't quite cope with it. Or it did, but things have changed now.
When I run:
ionic browser remove crosswalk
ionic browser remove crosswalk-lite
ionic browser add crosswalk-lite
I get this ionic.projectfile:
{
"name": "chapter5",
"app_id": "27fa0870",
"browsers": [
{
"platform": "android",
"browser": "crosswalk-lite",
"version": "12.41.296.5"
}
]
}
ionic info output:
Cordova CLI: 4.2.0
Gulp version: CLI version 3.8.11
Gulp local:
Ionic Version: 1.0.0-rc.0
Ionic CLI Version: 1.4.5
Ionic App Lib Version: 0.0.22
OS: Distributor ID: Fedora Description: Fedora release 21
(Twenty One)
Node Version: v0.10.36
Also, take notice of your cordova-android version, when you run browser add:
Android project created with cordova-android#4.0.0-dev
And your cordova-crosswalk-engine. Mine says: c0.7.1
Those are all inter-related and may lead to weird errors.