Errors trying to build Cordova Window app - javascript

I have a cordova application that runs fine on android, iOS and wp8. Now we would like it to run on windows. I have added the platform using the following command
cordova platform add windows
This adds all the plugins for me, now i build the project using
cordova build windows
For some reason my plugins and other basic features are not working. For example, i have the following cordova plugins installed
cordova plugin list
org.apache.cordova.splashscreen 1.0.0
org.apache.cordova.statusbar 0.1.10
org.apache.cordova.console 0.2.13
org.apache.cordova.camera 0.3.6
I havent tried camera yet, but upon my application starting, i try to hide the splash screen and status bar, and i get these errors
Exception was thrown at line 96, column 9 in
ms-appx://MY.APP.ID/www/plugins/org.apache.cordova.statusbar/src/windows/StatusBarProxy.js
0x800a138f - JavaScript runtime error: Unable to get property
'hideAsync' of undefined or null reference
and
Exception was thrown at line 82, column 9 in
ms-appx://MY.APP.ID/www/plugins/org.apache.cordova.splashscreen/www/windows8/SplashScreenProxy.js
0x80004002 - JavaScript runtime error: No such interface supported
I have even tried to show a console.log, which never shows anymore? I know in WP8 projects you have to change the DEFINE DEBUG flag, but i cannot find this on the new windows project.
To get round console, i thought i would try and show an alert, which you can do with
(new Windows.UI.Popups.MessageDialog("Content", "Title")).showAsync().done();
But i get an error message of
Exception was thrown at line 47, column 9 in
ms-appx://com.measure2improve.m2ianywhere/www/plugins/org.apache.cordova.dialogs/src/windows/NotificationProxy.js
0x80070005 - JavaScript runtime error: Access is denied.
I am obviously missing something here, if someone could let me know what i have missed, would be very much appriecated.

Related

Can't get out of the Visual Studio 2019 sandbox to access LAN

I’m using Visual Studio 2019 to develop a Taskpane for Excel to download sensor data to a spreadsheet. I’m obtaining the data over Wi-Fi via an ESP8266 TCP socket server module which is a node on my LAN(thus the URL 192.168.0.7:81). The html and Javascript work fine in Internet Explorer(IE). There is no password or LAN SSID involved.
The Javascript builds fine in VS2019 but immediately fails in debug.
Javascript:
Home.js contains:
line 8 - var connection = new WebSocket(‘ws://’ + ‘192.168.0.7’ + ‘:81/’, [‘arduino’]);
Upon Debug:
Build Succeeded with 0 Errors
'iexplore.exe' (Script): Loaded 'Script Code (Windows Internet Explorer)'.
Unhandled exception at line 8, column 1 in https://localhost:44390/Home/Home.js
0x800a139e - JavaScript runtime error: SecurityError
The program '[11136] iisexpress.exe' has exited with code 0 (0x0).
The program '[2236] EXCEL.EXE' has exited with code 0 (0x0).
The program '[10844] iexplore.exe' has exited with code 1 (0x1).
I’ve looked everywhere for explanations of the 0x800a139e SecurityError but found nothing that helped solve the problem.
It appears to be a general JS syntax error but the code works fine in IE and IE is the selected browser in VS2019. Running Code Analysis shows no errors with the JS. Note: I'm using straight JS for this not jquery because, as I understand it, jquery is simply a library that converts to JS for compilation and I have no clue how this line would be constructed in jquery.
Also, if I use Tools/Connect to Server it cannot find 192.168.0.7. Is this because it only looks for sql servers or because I have a VS2019 configuration problem?
This is most frustrating due to lack of specific error definition.
Thanks

Meteor: Can’t get updates to Android Emulator (Hot Code Push)

I'm doing mobile development on an Android Emulator with Genymotion. I can't get any code changes to show up on the emulator. I always get this error, even on Startup:
Skipping downloading new version because the Cordova platform version or plugin versions have changed and are potentially incompatible
I know this a protection mechanism from bad updates, but It happens all the time. I can't even make a small CSS or JS change. They all get blocked. I tried it on Android 4.4.4, 5.0 and 6.0.
I'm using Meteor 1.4.1.2 and I simply run meteor run android-device and it pops up on the Genymotion device.
Anyone know what's causing this?

Console log is not working with Netbeans (Android emulator and Cordova)

Everything works fine except there is no output when calling console.log(...) in the Browser window log (Netbeans).
I created a new HTML5 (Cordova Application) project in Netbeans.
I start the android emulator (Intel Atom x86 API Level 19. Galaxy Nexus. With Use Host GPU option checked). Then build/run the project BUILD SUCCESSFUL (total time: 10 seconds) and I can see the app running in the emulator with the 'Device is ready' text blinking.
But there is not console log output. I have made sure the Debugger Console plugin is selected (inside the project properties). I also have added android:debuggable="true" inside <application .../> tag in AndroidManifest.xml file. And still no console log output.
I have also tested with API 21 and still no ouput from console.log
What am I missing?
I'm using cordova 4.3.0, Netbeans 8.0.2, Java version: 1.8.0_45, Apache Ant 1.9.4.
Thanks in advance.
UPDATE: I can see the log entry with DDMS but since I'm using Use Host GPU, Logcat is spammed with an error and by the looks of it, the filter doesn't work as expected and sometimes it stops logging for whatever reason (DDMS). At least I know the console.log call works inside the javascript. By the looks of it, DDMS is buggy.
I think I found out why Netbeans isn't picking up any log output.
Debugger console seems to only work for Xcode and/or maybe Netbeans isn't configured to get any log from LogCat. Cordova redirects console.log calls to their respective platform logger. That's why I can see the log entry just fine with adb logcat -s "CordovaLog" (CordovaLog being the tag to filer).
Edit:
Netbeans doesn't connect fast enough and it doesn't show you earlier logs. I recommend to use Chrome remote debugging instead of Netbeans.
While this is not a direct answer to your question, NetBeans personally recommends that you use Chrome with their extension for HTML5 projects:
https://netbeans.org/kb/docs/webclient/html5-gettingstarted.html
Hope that works for you!
2 things that might help: Make sure you have Cordova plugin called "Debugger Console" in your project
Second thing try to use NetBeans dev build from here . The dev build contains importnant fix - IDs of core Cordova plugins has been changed recently and as a result NetBeans could be removing these plugins from build when building the project.

What is a V8Exception error?

I'm not sure what this error is coming from, nor what it is or what it means. Here is the error I get:
[ERROR] : V8Exception: Exception occurred at undefined:1: Uncaught SyntaxError: Unexpected token u
Now, I am creating an HTML 5 Cross platform (Android/iOS) application using Titanium Studio IDE. I'm not sure if this is an Android specific error or a Titanium Studio specific error. I know it can't be iOS because I only get this error when I am trying to test the app on Android tablet. (The app installs and runs on the device though).
NOTE: The code I am working on is proprietary so I can't show it. But what I'm mostly interested in an explanation of this error. Generally, What is this error and when does some one come across it?

Deploying JS apps to Windows 8 gets resources.pri access denied error

I'm trying to run my apps, but it is suddenly getting this error. I don't know why. I haven't changed anything.
Error 3 Error : DEP0500 : The folder "C:\Users\Shane\Documents\Visual Studio 2012\Projects\App2\App2\bin\Debug\AppX" could not be deleted.
Access to the path 'resources.pri' is denied,
I'm running VS2012 as Administrator and I've removed everything from the debug directory. I can't find anything on how to get rid of this error.
Looks like this is a bug with Parallels. If you kill prl_cc.exe the files should be unlocked.
Are you sure all instances of your app, including those in the simulator are terminated?
If you are using Windows on Mac with Parallels, it seems to be a known issue and there is a workaround here:
http://forum.parallels.com/showthread.php?267785-Parallels-Control-Center-is-incorrectly-locking-my-pri-files

Categories