Closed jgw96 closed 7 years ago
From @condorman on November 23, 2016 14:53
+1 help!
Please provide some relevant information, like which plugins you are trying to use, so we can help.
Also note that certain plugins, especially ones that need access to the device file system will not work with live-reload. Since the source is technically on your computer, and not on the device, it does not have access to the devices file system. So some plugins not working is expected.
@mhartington none of the plugins are available, cordova.js
has just one line of text with something about dev mode.
how can I reproduce this.
I was running a app on a Samsung Galaxy Tab with ionic run android --device --livereload
and that's about it.
It used to work just fine a few days ago when I ran the app on a Genymotion device though.
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
"ionic-plugin-deploy",
"cordova-plugin-image-picker",
"cordova-plugin-camera",
"cordova-plugin-compat",
"phonegap-nfc"
]
the problem is cordova.js don't loaded:
when you open console from chrome cordova.js not load and so plugins fail.
thanks @condorman, that's what I was looking for.
Ok, I can confirm this, cordova.js is not being loaded in.
cc @jthoms1
revert to ionic 2.1.8 start: ionic run android -lc start in separate cmd: npm run watch works form me currently with app scripts 0.0.46 & Ionic 2 RC3
I am using the SecureStorage, for me this workarround will not work because with the downgrade to 2.1.8 the linking to the plugins seems to be missing. For me it looks like, that there is something elementary broken in connection with ionic-native and Cordova plugins. Developing the app in the Browser is not sufficient in my case (because of the cordova plugins)
@jthoms1 Is there any update on this?
I think this is fixed with the 0.0.47
release. At least I just updated and it seems to be working.
I'm seeing this issue with Ionic 3
I had the same problem today with a new menu based project. (ionic 3)
I'm having exactly the same issue today. After the ionic cli 3.8 update. When working with previous cli everything was working correctly
Edit:
I can confirm that downgrading to cli 3.7.0 solves the issue. So maybe a change made broke something.. I noticed that when running the -lcs option in 3.7.0 gives:
Starting app-scripts server: --livereload --l --consolelogs --c --serverlogs --s --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --nobrowser - Ctrl+C to cancel
and when running the same thing in 3.8.0 it gives:
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --consolelogs --serverlogs --nobrowser - Ctrl+C to cancel
Hope this helps to solve the problem
I just noticed this same issue in 3.8.0
I also faced the same issue after update CLI from 3.7.0 to 3.8.0. Please fix it, thanks.
Still experiencing this.
I was trying endlessly every suggestion I could find and nothing worked. Eventually I deleted node_modules/
and platforms/
, did npm install
and ionic cordova prepare
and that solved it. There sure is some weirdness going on inside cordova.
still have this problem with 3.9.2
I'm having this problem in Ionic CLI 3.19.0 with Android platform 7.0.0 and Cordova 8.0.0. It only occurs if I use ionic cordova run android -lcs
. If I remove -lcs
flag it works properly.
I already tried to remove node_modules/
, plugins/
and platforms/
folders and then install everything again.
These are the messages that I got from console:
[13:16:51] console.warn: Native: tried accessing the SQLite plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
[13:16:51] console.warn: Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
[13:16:51] console.warn: Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
I analyzed the built apk and the cordova.js
inside it is the same of platform folder. So it is not empty nor just one line of text with something about dev mode as @rolandjitsu said.
I also realized that SQLite plugin may not work because it maybe need access to the device file system as @mhartington said? But the other plugins (StatusBar and SplashScreen) also do not work and gives the same message. So none of the plugins is working.
Anyone can help me with this issue?
Having the same as @tembra , 3.19.0, that cordova.js is missing when --livereload flag is appended. Works: ionic cordova run android --device Does not work: ionic cordova run android --device --livereload
I'm also having the same issue as @tembra and @hiroki-gota, with ionic 3.19.0, cordova-android 7.0.0 and cordova 8.0.0, only with livereload.
FIX: You need go to node_modules/@ionic/app-scripts/dist/dev-server/serve-config.js
and replace:
exports.ANDROID_PLATFORM_PATH = path.join('platforms', 'android', 'assets', 'www');
to
exports.ANDROID_PLATFORM_PATH = path.join('platforms', 'android', 'app', 'src', 'main', 'assets', 'www');
I found it here [(https://stackoverflow.com/a/48266685)]. And for me it worked !!
I have same issue and now it's OK. tks @BritoMatheus, it's work for me :) file need to edit: node_modules\@ionic\app-scripts\dist\dev-server\serve-config.js some info: cli 3.19.1, cordova 8.0, Windows_10, android 7.0 command: ionic cordova run android --device --livereload
Works for me too :)
Thanks @BritoMatheus!
@britoMatheus it solved the problem! Thanks!
Thanks @BritoMatheus, that is the best workaround we have at the moment, aside from downgrading the Android Cordova platform to 6 (cordova platform add android@6
).
Please track the new issue here: https://github.com/ionic-team/ionic-app-scripts/issues/1380
Locking as the new issue is not the same as the original issue.
From @rolandjitsu on November 23, 2016 14:31
Ionic version: (check one with "x") [ ] 1.x [x] 2.x
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
It seems like cordova plugins are not loaded when I run the app on an external device with the
--livereload
flag.Expected behavior:
I'm not sure if this is intended behaviour, but if it is, it might not be the best idea to only load plugins when the app is run without the flag as I do not want to make requests to my production server when I am actually just testing the app (right now running without the liverload flag it will build for production). It should load the cordova plugins whenever the app is run on a device.
Steps to reproduce:
Related code:
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Copied from original issue: driftyco/ionic#9309