Error on Installation of Android Platform to Bootstrap 5 App Project

I catch this error when I install the Android Platform:

TypeError: Cannot read property ‘unshift’ of undefined at _execCommand () at at at at at ChildProcess. (C:\Users\user\AppData\Local\Wappler\package.nw\node_modules\winreg\lib\registry.js:664:7) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1047:16) at Socket. (internal/child_process.js:438:11) at Socket.emit (events.js:314:20) at Pipe. (net.js:672:12)
TypeError: Cannot read property ‘unshift’ of undefined at _execCommand () at at at at at ChildProcess. (C:\Users\user\AppData\Local\Wappler\package.nw\node_modules\winreg\lib\registry.js:664:7) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1047:16) at Socket. (internal/child_process.js:438:11) at Socket.emit (events.js:314:20) at Pipe. (net.js:672:12)

Also, it predominantly posts this message:

Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant™ version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_281 (Oracle Corporation 25.281-b09)
OS: Windows 10 10.0 amd64
Gradle could not detect version!

I am also not able to simulate projects using the device.
How can I fix this?
ATTN: @Teodor

Thanks.

It looks as if you do not have Gradle installed?

Below are a few posts relating to installing Gradle. Can be a little bit of a pain to set-up but for Android it is necessary.

https://community.wappler.io/search?q=install%20gradle

Thanks Dave. I’m looking into it now.

I’ve followed Dave’s steps to install Gradle and successfully did (thanks @Dave) . However, this error still shows:

TypeError: Cannot read property ‘unshift’ of undefined at _execCommand () at at at at at ChildProcess. (C:\Users\user\AppData\Local\Wappler\package.nw\node_modules\winreg\lib\registry.js:664:7) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1047:16) at Socket. (internal/child_process.js:438:11) at Socket.emit (events.js:314:20) at Pipe. (net.js:672:12)

In the list of devices, the installed simulation device on Android does not show either.
Please help. Thanks.

Try removing Android from the Project (back it up first though). Save and exit. Reboot your machine. Open Wappler run the System Check, and add the Android Platform again. Pain in the arse but may help rectify it… Can all be a little bit hectic getting it up and running but once done it gets a lot simpler I promise.

:wink:

1 Like

Are your issues resolved @abecker?

:slight_smile:

Hi @Dave I just tried the entire process again and this still shows:

I uninstalled and reinstalled Android SDK, Remove and reinstalled Android Platform
FOllowed the Cordova guide, step by step and still this:

TypeError: Cannot read property ‘unshift’ of undefined at _execCommand () at at at at at ChildProcess. (C:\Users\user\AppData\Local\Wappler\package.nw\node_modules\winreg\lib\registry.js:664:7) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1047:16) at Socket. (internal/child_process.js:438:11) at Socket.emit (events.js:314:20) at Pipe. (net.js:672:12)

@Teodor

FAILED BUILD ATTEMPT:

  • What went wrong:
    A problem was found with the configuration of task ‘:CordovaLib:generateDebugRFile’ (type ‘GenerateLibraryRFileTask’).

File ‘D:\xampp\htdocs\visamour\platforms\android\CordovaLib\build\intermediates\local_only_symbol_list\debug\R-def.txt’ specified for property ‘loca
lResourcesFile’ does not exist.

  • Try:
    Checking Java JDK and Android SDK versions
    ANDROID_SDK_ROOT=C:\Users\user\AppData\Local\Android\sdk (recommended setting)
    ANDROID_HOME=C:\Users\user\AppData\Local\Android\sdk (DEPRECATED)
    Using Android SDK: C:\Users\user\AppData\Local\Android\sdk
    Subproject Path: CordovaLib
    Subproject Path: app

Task :CordovaLib:generateDebugRFile FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ‘:CordovaLib:generateDebugRFile’ (type ‘GenerateLibraryRFileTask’).

File ‘D:\xampp\htdocs\visamour\platforms\android\CordovaLib\build\intermediates\local_only_symbol_list\debug\R-def.txt’ specified for property ‘loca
lResourcesFile’ does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 4s
15 actionable tasks: 1 executed, 14 up-to-date
<-------------> 0% WAITING

IDLE

Command failed with exit code 1: D:\xampp\htdocs\visamour\platforms\android\gradlew cdvBuildDebug -b D:\xampp\htdocs\visamour\platforms\android\build.
gradle
Error running your Cordova Project for android!