usage of --livereload command in Ionic2/ Ionic3 - ionic2

Ionic CLI 3.8 has come up with a --livereload option to live reload the changes from your app. Can someone tell the proper command for using it?
I tried with only --livereload and also ionic cordova --livreload but neither seems to work!

Just like #Duannx mentioned in the comments, the proper CLI command is
ionic cordova run android --livereload / ionic cordova run ios --livereload
or
ionic cordova run android --l / ionic cordova run ios --l
(Or just ionic run android/ios --l if you're using an older version of the CLI).
Please notice that in order to make the livereload feature to work, both the device and the computer running the command must be in the same WIFI network.
Otherwise you'll see errors like:
The connection to the server was unsuccessful
(http://XX.XX.XX.XX:XXXX)

Related

Ionic2: Package com.my.app has no certificates at entry AndroidManifest.xml

I created one application using Ionic2 and when i run the command ionic cordova run android --prod --release I am getting an error
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl
971492117.tmp/base.apk has no certificates at entry AndroidManifest.xml]
Do anyone know how to fix this error?
NB: I have seen similar questions all of them are for native application development.
You cannot install a package build with --release without signing it. See this question on Ionic Forum
Try ionic cordova run android --prod to install an unsigned app to your phone.
Probably you have another app installed with the same name, signed with another type of key. Ie in your device you the app singed with a release key. Other possibility is there is an app in your device with a newer version.

ionic cordova plugin add cordova-plugin-advanced-http already installed

I am new on Ionic Mobile application development, so I am trying to POST data from Ionic app. Whenever I have run the app in browser using
ionic cordova run browser
It display below issue in console,
Native: tried calling HTTP.post, but the HTTP plugin is not installed.
Install the HTTP plugin: 'ionic cordova plugin add cordova-plugin-advanced-http'.
I have installed same plugin using terminal but terminal give warnings as its already installed.
Please Suggest.
Based on this https://ionicframework.com/docs/native/http/ you also need to run
npm install --save #ionic-native/http
and referencing it correctly in your app, please take a look at above link
Also for running app in browser try below command
Ionic serve
See https://github.com/ionic-team/ionic-native/issues/1975
The issue appears to have been fixed but there might be a lag in updating npm
I hade the same problem and I solve it with uninstall and reinstall the plugin
Uninstall plugin completely
ionic cordova plugin remove cordova-plugin-advanced-http
npm uninstall #ionic-native/http
and reinstall it
ionic cordova plugin add cordova-plugin-advanced-http
npm install #ionic-native/http
The Native Http plugin is the only way to handle the CORS from the client-side.
The way I see your problem, there might two possible fixes
Check whether the plugin is called after the platform.ready().
Even after it, if doesn't work or show the same error then follow this method.
// Declare cordova as a global constant
declare const cordova;
// directly call the cordova pulgin using "cordova.pulgin.http"
cordova.plugin.http.post(apiUrl, {}, {},
response => {},
response => {})

Ionic 2 app takes too much time to load even build with --prod flag

Well, I am new to ionic 2 and build my first app having 2 pages and 2 services which are the very simple and for a news website.
The problem is, first I build my app for android using --release flag the file size was near 4MB and when I deploy on my mobile the load time was 14 - 17 seconds.
Then I search for 2 days to fix this issue and came up with the idea that I should enable production mode in main.ts and build using --prod flag . Now file size is 2.65MB and load time is 8 - 11 seconds which I think too much time for a mobile device. :(
My system information is:
ordova CLI: 6.5.0
Ionic Framework Version: 3.2.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.10.0
Xcode version: Not installed
In my app I simply pulling news from rest server and displaying on my page. Am I doing something wrong or is there any issue with new version of ionic? I also read by some people that ionic 1 speed was good than the latest version.
Note: I run my app on 3 different devices the issue remain the same.
Check your config.xml, and set SplashScreenDelay value to zero
<preference name="SplashScreenDelay" value="0"/>.
For me, below command worked:
ionic cordova build ios --prod --aot --minifyjs --minifycss --optimizejs
You can use your own platform in above command instead of ios.
It decreased app load time in my case.
Please find more details here https://forum.ionicframework.com/t/ionic-app-takes-too-long-to-start/97546

Ionic-Native issue in ionic 2

I have added a Cordova file transfer plugin from Ionic native and imported transfer from ionic native to my application page
I am not getting any syntax error as well as command prompt errors
But when I run my application using Ionic serve it is showing me
{Cannot find module "ionic-native"}
Can anyone please help me on this
Did u check it properly, weather u have installed ionic-native ?
Plus which version of ionic are you using, in ionic 3 (launched recently) they removed ionic-native and kept it seperately in #ionic-native. And u'll have to indivisually install every plugin u r using.
http://blog.ionic.io/ionic-native-3-x/

Running Sencha Touch app on Java Eclipse & Android Emulator on Windows 8 (without phonegap)

I am getting trouble in running sencha touch 2 app on android emulator (without using cordova/phonegap) on windows 8 using .
Below is the list of packages installed on DEV machine:
1. JRE v1.7
2. Sencha Touch v2.4.1 SDK
3. Sencha SDK Tools 2.0.0 beta
4. Sencha Cmd 5.1.2
5. Ruby 2.0.0
6. Chrome (Browser)
7. Web Server - Both IIS 8 & XAMPP
8. Android SDK 23.0.6
9. Eclipse IDE (integrated with VJET Library & ExtJSTL 4.2)
10. Android ADT Manager (installed emulator snapshots targeting os2.2 & 5.1)
"MyApp" project runs perfectly on chrome browser when hosted on IIS 8 & XAMPP (apache). But not able to figure out steps to run the same on android emulator. So far followed below mentioned steps, leading to unsuccessful attempts:
sencha app build native [Command Successful]
sencha app build -run native [Command Successful]
sencha app build package [Command Successful]
Started emulator instance from eclipse (avd) and executed command sencha app build -run native, but the app doesn't execute on emulator instance.
Followed steps mentioned in post (http://www.sencha.com/forum/showthread.php?215210-how-to-run-sencha-touch-app-on-android-emulator-on-windows) but still facing issues.
Please help!!
do u want to run it as website for mobile?
as u are saying, you don't want to use cordoav/phonegap.
If u just want to run on Mobile Browser U can use Netbeans. It has a very simple feature to allow a html5 application to be run on Mobile browser
all U have to do is
1. Create HTML5 Project in netbeans
2. Run command "sencha app build native"
3. copy all files & folders form directory cordova->www which exist in your sencha app directory
4. Paste it into your HTML5 Project directory
5. Choose The Browser option in netbeans and run
Thanks Nitish for your suggestions. But this is not what my query was all about. I was trying to figure out a way of running sencha touch app on emulator without compiling it to native app following steps mentioned in post: http://www.sencha.com/forum/showthread.php?215210-how-to-run-sencha-touch-app-on-android-emulator-on-windows.
Anyways, to run sencha touch app on emulator I had to create native android app using cordova/phonegap wrapper. To run sencha touch app (which is mobile web portal equivalent), it is required to be wrapped inside native app (android, ios, etc) followed by app signing and APK / IPA file generation.