Problems testing mobile apps

OS info

  • Operating System : Windows 10.0.19041
  • Wappler Version : 3.5.0

Problem description

Can’t test any mobile app, not even the basic mobile template. Errors in output when trying to add platforms > Android (or any other)

Steps to reproduce

  1. New Project > Mobile > Blank
  2. Add Platform > Android
  3. “The platform Android 8 is not installed in your current Cordova Project. Would you like to install it?” YES

It copies a load of files and then showed this:

Using cordova-fetch for cordova-android@^8.0.0
Failed to fetch platform cordova-android@^8.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Could not determine package name from output:
added 54 packages, and audited 54 packages in 4s

1 package is looking for funding
run npm fund for details

3 high severity vulnerabilities

To address all issues, run:
npm audit fix

I went to Terminal and typed npm audit fix and got another error…

npm audit report

dot-prop <4.2.1 || >=5.0.0 <5.1.1
Severity: high
Prototype Pollution - https://npmjs.com/advisories/1213
fix available via npm audit fix --force
Will install cordova-android@9.0.0, which is a breaking change
node_modules/dot-prop
compare-func <=1.3.4
Depends on vulnerable versions of dot-prop
node_modules/compare-func
cordova-android 8.1.0-nightly.2019.8.21.bd1697db - 9.0.0-nightly.2020.4.1.c56cd4d5
Depends on vulnerable versions of compare-func
node_modules/cordova-android

3 high severity vulnerabilities

To address all issues (including breaking changes), run:
npm audit fix --force

I typed the above command in Terminal…

npm WARN using --force Recommended protections disabled.
npm WARN audit Updating cordova-android to 9.0.0,which is a SemVer major change.

added 40 packages, removed 6 packages, changed 12 packages, and audited 88 packages in 6s

I then tried adding the Android platform again…

Android project created with cordova-android@9.0.0
Plugin ‘cordova-plugin-whitelist’ found in config.xml… Migrating it to package.json
Discovered saved plugin “cordova-plugin-whitelist”. Adding it to the project
Failed to restore plugin “cordova-plugin-whitelist” from config.xml. You might need to try adding it again. Error: Failed to fetch plugin cordova-plug
in-whitelist@1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
added 1 package, and audited 89 packages in 1s

6 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
npm ERR! code 1
npm ERR! path D:\web\Wappler sites\Test2
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c “cordova “platform” “add” “android””

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Gary\AppData\Local\npm-cache_logs\2020-11-06T11_24_29_898Z-debug.log
Error adding android to your Cordova Site!

I have tried uninstalling Wappler and re-installing it. A System Check shows NodeJS and Cordova are correctly installed. I’ve got the latest Gradle and Android Studio installed. Any suggestions please? Thank you.

Bump! For what it’s worth, Android Studio can build and emulate APKs on the same desktop that Wappler is installed on. I just can’t get Wappler to do anything because of the errors.

I fixed this outside of Wappler by creating a new app with Cordova in the CLI, then following up on the almost never-ending error messages and solutions at stackoverflow.com. It took several hours to finally get there.

Now within Wappler I can create, build and emulate the app for Android. Phew! :smiley: Next I need to find out how to create an app for iOS. Presumably I’d have to copy the entire project from Windows over to a real Mac and build the IPA file in Terminal/Xcode? :thinking: