Script Error: ReferenceError: isAndroid is not ... no method 'startsWith'

174 views
Skip to first unread message

Jo Elegolo

unread,
Nov 7, 2019, 5:46:48 AM11/7/19
to DroidScript
Hello!
Sorry, I do have a severe problem. Trying to use DroidScript on Samsung Tablet with Android 4.4.4 (API level: 19) using Cyanogenmod.
Error Dialog at (the end of? App screen seen in background) startup:
-------------------------------------------------------------------
Script Error
_________
Script Error: Object Uncaught ReferenceError:
isAndroid is not defined has no method
'startsWith'
Source: file://android_asset/DroidScript.js
Line: 1017
________________________________________
                      OK
--------------------------------------------------------------------
After 'OK' DroidScript terminates.

So far, problem popped up after having installed a lot of other Apps.
Reboot does not change problem state.
Deinstallation (all plugins as well) and Reinstallation of DroidScript does not change error state.

Any idea what I could do?

Jo Elegolo

unread,
Nov 7, 2019, 6:29:51 AM11/7/19
to DroidScript
Addendum: Error did not occur before update to 1.78 - maybe API level 19 is no longer supported?

Jo Elegolo

unread,
Nov 7, 2019, 7:00:19 AM11/7/19
to DroidScript
Addendum 2: 1.76 works without this problem.

Symbroson

unread,
Nov 7, 2019, 7:16:52 AM11/7/19
to DroidScript
Thanks for the report. I'll look into this later today and I may contact you privately to test some things if I cannot reproduce the problem.

Jo Elegolo

unread,
Nov 22, 2019, 6:25:22 AM11/22/19
to DroidScript
After frequently replacing the automatically reinstalled version 1.78 by 1.76, I once more came to the error (1.78 reinstalled again), but saw the error with a modified message:
Script Error
_________
Script Error: Object agent = Mozilla/5.0 (Linux;
Android 4.4.4; SM-T230NU Build/KTU84Q)
AppleWebKit/537.36 (KHTML, like Gecko)
Version/4.0 Chrome/30.0.0.0 Safari/537.36
has no method 'startsWith'
Soure: file:///android_asset/DroidScript.js
Line:1017
____________________________________
(I hope, this manual copy of the error is all right)
 
Perhaps that could help finding the problem, which must be specific for my system, as no one else seems to run into it.

Meanwhile I also had problems with my favorite browser Firefox, which I had to replace by Google Chrome for now.

I have a workaround, don't hurry :)

Greetings

Symbroson

unread,
Nov 22, 2019, 6:47:58 AM11/22/19
to DroidScript
I sent you a private email in reply on this thread on November 7. Did you receive it?

Dave

unread,
Nov 22, 2019, 6:48:25 AM11/22/19
to DroidScript
It's fixed in the next release.  Older phones don't fully support ES6 JavaScript features, so I've added the following polyfill to DS:-


if (!String.prototype.startsWith) {
   
Object.defineProperty(String.prototype, 'startsWith', {
        value
: function(search, rawPos) {
           
var pos = rawPos > 0 ? rawPos|0 : 0;
           
return this.substring(pos, pos + search.length) === search;
       
}
   
});
}


Message has been deleted

Lenka Vychytil

unread,
Dec 5, 2019, 8:40:13 AM12/5/19
to DroidScript
Hello
I have the same problem. Error at line 1017 in the doidscript.js file. How can I solve it or do I have to wait for the next version? And when will the new version be?
Thank you
LV

Steve Garman

unread,
Dec 5, 2019, 2:55:23 PM12/5/19
to DroidScript
There isn't really a practical way for you to fix it.

There will be a fix in the next telease but there is no date for that release yet.

The latest alpha 179a1b was issued before this issue was raised but a polyfill will be included in the next alpha.

If you want to know when the next alpha is available you could join the beta group.

Just email sup...@droidscript.org from the email address you use for this group explaining that you would like an invite to join the beta group.

Dave

unread,
Dec 6, 2019, 11:17:36 AM12/6/19
to DroidScript

Jo Elegolo

unread,
Dec 6, 2019, 12:00:33 PM12/6/19
to DroidScript
Thank You very much, Dave!
Problem fix confirmed! DroidScript works again on my Samsung TAB4 with Android 4.4.


Jo Elegolo

unread,
Jan 7, 2020, 6:17:27 AM1/7/20
to DroidScript
I have the same issue by using plugin BluetoothLE, but, hope that will be corrected with the next 'complete' DS version update. Am I right?

Jo Elegolo

unread,
Jan 7, 2020, 7:44:44 AM1/7/20
to DroidScript
To be onest, not just the identical issue, error tells:
Script Error: org.droidscript.plugins.BluetoothLE Source: file:///android_asset/app.js Line:1688
BluetoothLE plugin version is 1.05

Reply all
Reply to author
Forward
0 new messages