Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova android build error - The "path" argument must be of type string #756

Closed
marcelinojung opened this issue Nov 10, 2018 · 11 comments
Closed

Comments

@marcelinojung
Copy link

marcelinojung commented Nov 10, 2018

system info

OSX high Sierra 10.13.6
Cordova 8.1.2
npm 6.4.1
cordova-android 7.1.2

plugin version : 7.1.3, 7.2.4

When I add android platform in cordova, I got this error.
I found somtimes it occurs from 'path.resolve()'.
please help to fix it...

//---
Failed to install 'cc.fovea.cordova.purchase': TypeError [ERR_INVALID_ARG_TYPE]: Uh oh!
The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.resolve (path.js:1088:7)
at copyNewFile (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/lib/pluginHandlers.js:258:28)
at install (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/lib/pluginHandlers.js:43:17)
at ActionStack.process (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
at PluginManager.doOperation (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
at PluginManager.addPlugin (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
at /Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/Api.js:247:74
at _fulfilled (/Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/node_modules/q/q.js:834:54)
at /Users/urbanist/Desktop/web/cordova/trcng_new/platforms/android/cordova/node_modules/q/q.js:863:30

@j3k0
Copy link
Owner

j3k0 commented Nov 10, 2018

I just tried with on my mac:

  • plugin version 7.2.4
  • cordova 8.1.2 ([email protected])
  • node v10.12.0
  • macOS 10.14.1
  • npm 6.4.1

Sounds like an issue with cordova.

The bug is in the function that install source files to the appropriate location platforms/android/cordova/lib/pluginHandlers.js. You might be able to debug it, or report to the cordova-android folks.

I just checked: https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/pluginHandlers.js

It seems a recent PR was made to solve the issue:
apache/cordova-android#490

Cordova-android 7.1.2 has been recently released:
https://cordova.apache.org/announcements/2018/11/07/cordova-android-7.1.2.html

Worth giving it a try!

cordova platform remove android
cordova platform add [email protected]

@marcelinojung
Copy link
Author

marcelinojung commented Nov 10, 2018

Thanks.
I'll try ..
cordova platform add [email protected] - success,
but
cordova platform add [email protected] - fail

@surya-alive
Copy link

Hi,, I've same issue here.
I tried to upgrade 7.1.2 and the result still not working

@j3k0
Copy link
Owner

j3k0 commented Nov 12, 2018

Hi @surya-alive, it seems like you have to use 7.1.1. The cordova team is on it: apache/cordova-android#540

@surya-alive
Copy link

@j3k0 Thanks for your comment.. it's work on 7.1.1

@j3k0
Copy link
Owner

j3k0 commented Nov 14, 2018

Note: the fix is in cordova-android master branch. https://github.com/apache/cordova-android

@brodycj
Copy link

brodycj commented Nov 14, 2018 via email

@nagthgr8
Copy link

in my case the issue resolved when I remove & then add platform android looks like for every cordova update this step is mandatory

@brodycj
Copy link

brodycj commented Nov 15, 2018

[...] when I remove & then add platform android looks like for every cordova update this step is mandatory

I had a similar experience, Cordova does not seem to do npm-style package updates. Not sure if someone may have fixed it in master or not.

@PatAbah
Copy link

PatAbah commented Oct 21, 2020

  1. same issue here

@j3k0
Copy link
Owner

j3k0 commented Oct 26, 2020

  1. same issue here

That would mean you're using an old version of cordova-android. The issue was definitely fixed 2 years ago. What version of cordova-android and the plugin are you using? You can paste the output of cordova info (run in your project) for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants