简体   繁体   中英

Some JS code missing after Cordova run

I have some functions in application.js file included in HTML files via <script> tag. The IDE I am using is PhpStorm and using Cordova platform.

I use the command cordova run android --device to run the app directly on my Android device connected over WiFi.

The weird problem is when I run some JS functions, var initialization and call to the functions fo missing from the .js file. When I press Ctrl + Z in PhpStorm, it asks "Undo reload from disk?" and on clicking "OK", the missing code appears back.

Note: The code goes missing after LAUNCH SUCCESS appear in the terminal.

What could be the problem?

Could not figure out the reason why it happened, but the issue disappeared after removing and adding again the platform Android.

cordova platform rm android
cordova platform add android

The issue might occur again, I believe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM