B
B
BonBon Slick2020-08-31 06:29:44
Apache Cordova
BonBon Slick, 2020-08-31 06:29:44

The "path" argument must be of type string?

Stack and issues did not help, downgrading to 1 major version is unacceptable, and deleting and adding the platform as well as rebuilding it with cleaning all the generated nuxt and cordova cache gave nothing.

More details in the new ISUS

The error crashes at the stage of adding the platform

[email protected]:/var/www/123/cordova$ cordova platform add android
Using cordova-fetch for [email protected]^8.1.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms/android
        Package: com.sgx.sample
        Name: SGX_Step_Counter
        Activity: MainActivity
        Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]

--->> config file undefined requested for changes not found at /var/www/123/cordova/platforms/android/undefined, ignoring
--->> config file undefined requested for changes not found at /var/www/123/cordova/platforms/android/undefined, ignoring

Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Installing "cordova-plugin-whitelist" for android
Adding cordova-plugin-whitelist to package.json
...
Adding cordova-plugin-health to package.json
Discovered saved plugin "cordova-plugin-background-mode". Adding it to the project
Installing "cordova-plugin-background-mode" for android

--->> android-sdk version check failed (/var/www/test/cordova/platforms/android/cordova/android_sdk_version), continuing anyways.

Installing "cordova-plugin-device" for android
Adding cordova-plugin-background-mode to package.json
--->> config file undefined requested for changes not found at /var/www/test/cordova/platforms/android/undefined, ignoring
--->> config file undefined requested for changes not found at /var/www/test/cordova/platforms/android/undefined, ignoring
--->> The "path" argument must be of type string. Received type undefined


[email protected]:/var/www/test/cordova$ cordova plugin remove cordova-plugin-anyPackage
Uninstalling cordova-plugin-anyPackage from android
Uninstalling cordova-plugin-anyPackage from browser
js-module uninstall called : plugins/cordova-plugin-anyPackage/www/anyPackage.js
Removing "cordova-plugin-anyPackage"
Removing cordova-plugin-anyPackage from package.json
config file undefined requested for changes not found at /var/www/test/cordova/platforms/android/undefined, ignoring
config file undefined requested for changes not found at /var/www/test/cordova/platforms/android/undefined, ignoring
The "path" argument must be of type string. Received type undefined


and naturally the project then cannot be collected.
The error occurred after restarting the PC. Yesterday the project was going, turned off for the night, already broken in the morning. Let nothing be done.

What still didn't help
1. Run the build as sudo
2.
export ANDROID_HOME=~/Library/Android/sdk && export PATH=${PATH}:${ANDROID_HOME}/tools && export PATH=${PATH}:${ANDROID_HOME}/platform-tools


[email protected]:~$ echo $PATH
/home/bonbon/.yarn/bin:/home/bonbon/.config/yarn/global/node_modules/.bin:$HOME/Android/Sdk/platform-tools:$HOME/Android/Sdk/tools:/opt/gradle/gradle-6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin

[email protected]:~$ java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0+deb9u1-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)

[email protected]:/var/www/test/cordova$ cordova --version 
9.0.0 ([email protected])

[email protected]:~/Android/Sdk/build-tools$ ls -la
total 20
drwxr-xr-x  5 bonbon bonbon 4096 Aug 31 06:58 .
drwxr-xr-x 14 bonbon bonbon 4096 Aug 31 06:58 ..
drwxr-xr-x  5 bonbon bonbon 4096 Jul 30 21:21 28.0.3
drwxr-xr-x  6 bonbon bonbon 4096 Jul 30 20:08 30.0.1
drwxr-xr-x  6 bonbon bonbon 4096 Aug 31 06:58 30.0.2


"dependencies": {
    "cordova-android": "^8.1.0",
    "cordova-browser": "^6.0.0",
    "cordova-plugin-background-mode": "^0.7.3",
    "cordova-plugin-customurlscheme": "^5.0.2",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-geolocation": "^4.0.2",
    "cordova-plugin-health": "^1.1.5",
    "cordova-plugin-stepcounter": "git+https://github.com/ihadeed/cordova-plugin-stepcounter.git",
    "cordova-plugin-stepper": "^0.1.4"
  },
  "devDependencies": {
    "cordova-plugin-whitelist": "^1.3.4"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-customurlscheme": {
        "URL_SCHEME": "localhost",
        "ANDROID_SCHEME": " ",
        "ANDROID_HOST": " ",
        "ANDROID_PATHPREFIX": "/"
      },
      "cordova-plugin-geolocation": {},
      "cordova-plugin-stepper": {},
      "cordova-plugin-stepcounter": {},
      "cordova-plugin-health": {
        "HEALTH_READ_PERMISSION": "App needs read access",
        "HEALTH_WRITE_PERMISSION": "App needs write access",
        "GMS_VERSION": "16.0.1"
      },
      "cordova-plugin-background-mode": {},
      "cordova-plugin-device": {}
    },


are also broken
cordova platform add [email protected]
or
[email protected]
therefore there are suspicions that something has fallen off again, as it usually happens in linux

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question