SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Found an issue in SpiderBasic ? Please report it here !
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

Hi,

Trying to install cordova from spiderbasic. It gave syntax error at the end while creating a dummy app?

Can I ignore this? Or will this setup not succeed?

node: v12.22.9
npm: 8.5.1
java -version:
openjdk version "17.0.18" 2026-01-20
OpenJDK Runtime Environment (build 17.0.18+8-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.18+8-Ubuntu-122.04.1, mixed mode, sharing)

on Ubuntu 22.04.5 LTS 64 bit
Gnome 42.9
Wayland

Code: Select all

rudi@Slimbook:~/Apps/spiderbasic$ bash install-cordova.sh

Welcome to SpiderBasic Android app install check script.
To exit the script at anytime, type CTRL+C.

Using /home/rudi/Apps/spiderbasic path as SPIDERBASIC_HOME.

* NPM is already installed...

Installing cordova, please enter your sudo password if needed (you need to be online):
* Gradle is already installed...

* Android commandline tools already installed...

Installing Android SDK 35... (be sure to have java 17 installed, package should be 'openjdk-17-jre')
[=======================================] 100% Unzipping... platform-tools/sqlit

Android SDK installation finished.

Creating dummy app to validate Cordova installation
/usr/local/lib/node_modules/cordova/node_modules/nopt/lib/nopt-lib.js:68
  const StringType = typeDefs.String?.type
                                     ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:85:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/nopt/lib/nopt.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
💻 Exploring the world of SpiderBasic :o
Fred
Site Admin
Posts: 1863
Joined: Mon Feb 24, 2014 10:51 am

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by Fred »

No, it's not right I guess. Seems to be an error with cordova itself. It seems like your nodeJS version is too old:

https://github.com/apache/cordova-cli/issues/623

You need node 16.13.0 or above.

As you are running Ubuntu 22.04, you can try this to update your node in your term:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

https://linuxize.com/post/how-to-instal ... ntu-22-04/
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

I got the version updated:

These are the steps I took:

Code: Select all

sudo apt-get remove nodejs
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install nodejs -y
node -v
v24.13.1
I could build an .apk and an .aab file
But I got an error on the tablet
free translate form Dutch: 'You can't install the app on your device.

I am trying this from the file manager and the rights are changed so apps can be installed from the file manager on the tablet.
Do I need to change any other rights?
The tablet is running Android 15
💻 Exploring the world of SpiderBasic :o
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

Trying to install cordova again

Code: Select all

rudi@Slimbook:~/Apps/spiderbasic$ bash install-cordova.sh

Welcome to SpiderBasic Android app install check script.
To exit the script at anytime, type CTRL+C.

Using /home/rudi/Apps/spiderbasic path as SPIDERBASIC_HOME.

* NPM is already installed...

Installing cordova, please enter your sudo password if needed (you need to be online):
[sudo] wachtwoord voor rudi: 
* Gradle is already installed...

* Android commandline tools already installed...

Installing Android SDK 35... (be sure to have java 17 installed, package should be 'openjdk-17-jre')
[=======================================] 100% Computing updates...             

Android SDK installation finished.

Creating dummy app to validate Cordova installation
Creating a new cordova project.
Using cordova-fetch for cordova-android
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.example.hello
	Name: HelloWorld
	Activity: MainActivity
	Android Target SDK: android-35
	Android Compile SDK: 35
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@14.0.1
(node:20002) [DEP0176] DeprecationWarning: fs.F_OK is deprecated, use fs.constants.F_OK instead
(Use `node --trace-deprecation ...` to show where the warning was created)
Installing "cordova-plugin-nativeaudio" for android
Adding cordova-plugin-nativeaudio to package.json
Installing "cordova-plugin-geolocation" for android
Adding cordova-plugin-geolocation to package.json

Cordova installation finished, SpiderBasic is ready to create Android apps.
No result

Cordova With the older version 20.x:

Code: Select all

rudi@Slimbook:~/Apps/spiderbasic$ bash install-cordova.sh

Welcome to SpiderBasic Android app install check script.
To exit the script at anytime, type CTRL+C.

Using /home/rudi/Apps/spiderbasic path as SPIDERBASIC_HOME.

* NPM is already installed...

Installing cordova, please enter your sudo password if needed (you need to be online):
* Gradle is already installed...

* Android commandline tools already installed...

Installing Android SDK 35... (be sure to have java 17 installed, package should be 'openjdk-17-jre')
[=======================================] 100% Computing updates...             

Android SDK installation finished.

Creating dummy app to validate Cordova installation
Creating a new cordova project.
Using cordova-fetch for cordova-android
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.example.hello
	Name: HelloWorld
	Activity: MainActivity
	Android Target SDK: android-35
	Android Compile SDK: 35
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@14.0.1
Installing "cordova-plugin-nativeaudio" for android
Adding cordova-plugin-nativeaudio to package.json
Installing "cordova-plugin-geolocation" for android
Adding cordova-plugin-geolocation to package.json

Cordova installation finished, SpiderBasic is ready to create Android apps.
Still not able to install the app
💻 Exploring the world of SpiderBasic :o
Fred
Site Admin
Posts: 1863
Joined: Mon Feb 24, 2014 10:51 am

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by Fred »

You need to enable the debugger if you want to deploy your app or you need to sign it.
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

Thanks very much Fred

This works fine now.

I used the debug mode. This leaves the debug window open.
To sign the App? Via terminal will be ok?: https://randombits.dev/articles/android ... g-with-cmd

Why didn't I discover PureBasic and SpiderBasic sooner? Better late than never, I guess.
Hope I can tackle the learning curve, not getting any younger. Step by step. I have time.

Greetings from Belgium
Rudi
💻 Exploring the world of SpiderBasic :o
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

I signed the .apk
The app intalled ok.
The debug window is now gone. But when a dialog is called, and that doesn't work anymore.
Do I have to do something with the .aab file? It's nor clear to me what is the purpose of this file. I guess it has something to do with the debugging?
💻 Exploring the world of SpiderBasic :o
AZJIO
Posts: 88
Joined: Wed Dec 14, 2022 1:13 pm

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by AZJIO »

RBart wrote: Fri Feb 20, 2026 6:12 pm To sign the App? Via terminal will be ok?
You can sign using APK.Tool.GUI.v3.0.2.0. There are also programs for Android to sign the application directly on your phone: Apktool M. But I haven’t used it, I want to try it.

Using your link I ran the first command and added the key. But I couldn't execute the second line using SpiderBasic.

Code: Select all

Start "" "...\SpiderBasic\Android\android\sdk\build-tools\35.0.0\apksigner.bat"...
The cmd file showed that you have too many tags, more than 30, I didn’t even understand what was meant.
User avatar
RBart
Posts: 21
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by RBart »

AZJIO wrote: Sat Feb 21, 2026 9:49 am
RBart wrote: Fri Feb 20, 2026 6:12 pm To sign the App? Via terminal will be ok?
You can sign using APK.Tool.GUI.v3.0.2.0. There are also programs for Android to sign the application directly on your phone: Apktool M. But I haven’t used it, I want to try it.

Using your link I ran the first command and added the key. But I couldn't execute the second line using SpiderBasic.

Code: Select all

Start "" "...\SpiderBasic\Android\android\sdk\build-tools\35.0.0\apksigner.bat"...
The cmd file showed that you have too many tags, more than 30, I didn’t even understand what was meant.
I am on Ubuntu 22.04. This APK.Tool is for Windows. If I can avoid Windows, I will. Almost always I can avoid it. I don't know what you mean by 'execute the second line using SpiderBasic' I only use the terminal on Linux to sign the APK not SpiderBasic. I don't know about the .aab file?
💻 Exploring the world of SpiderBasic :o
AZJIO
Posts: 88
Joined: Wed Dec 14, 2022 1:13 pm

Re: SB 3.2 Syntax error installing cordova on Ubuntu 22.04

Post by AZJIO »

RBart wrote: Sat Feb 21, 2026 10:14 am I am on Ubuntu 22.04. This APK.Tool is for Windows.
wine?
RBart wrote: Sat Feb 21, 2026 10:14 am I don't know what you mean by 'execute the second line using SpiderBasic' I only use the terminal on Linux to sign the APK not SpiderBasic. I don't know about the .aab file?
/spiderbasic_demo/android/android/sdk/build-tools/35.0.0/apksigner sign --ks-key-alias YOUR_KEY_ALIAS --ks YOUR_KEYSTORE_PATH app-release.apk
RBart wrote: Sat Feb 21, 2026 10:14 am I only use the terminal
RBart wrote: Sat Feb 21, 2026 10:14 am not SpiderBasic
the terminal doesn't sign anything, it launches another program that signs
Post Reply