Closed kiransiemens closed 4 months ago
i'm getting the same error running cordova build android with cordova android 12.
Please validate your local build environment by building the example project which is a known working codebase.
Below is the console output of the example project building with the latest plugin version using cordova-android@12
in my local build environment.
If you can reproduce the error with the example project, please fill out the issue template including the full console output, appending the --verbose
argument to the CLI command which raises the error.
If the issue template is not filled out fully with your environment info and details of the error, I will be unable to investigate and this issue will be closed.
Console output
If you are able to reproduce the issue in the example project, please open a new issue and fill out the issue template in full, including steps to reproduce in the example project and details of test devices used to reproduce the issue.
I am also running into this issue now on Windows with Cordova 12.0.0, node 20.5.0, Java 11.0.21, and cordova-android 12.0.1. I have Android Studio 2023.1.1 Patch 2 installed. When I run cordova platform rm android --verbose
on a project that had previously added the android platform, I get the error:
No scripts found for hook "before_platform_rm". TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('EBUSY') at process.set [as exitCode] (node:internal/bootstrap/node:123:9) at C:\Programs\nvm\v20.5.0\node_modules\cordova\bin\cordova:32:22
When I try to remove the platforms directory with rm platforms
(Yes to All), I get a number of WriteError ... IOException
errors because some directories cannot be removed. Java is locking the file classes.dex
for some reason, and the cordova platform rm android
command is failing due to that -- but is providing a misleading error message.
After forcing java to quit, cordova platform rm android
worked correctly.
I have the same problem on MacOS... the problem for me was an xml node not closed correctly!!
If in the config.xml you have an xml node like this:
<plugin name="cordova-plugin-someplugin">
when you try to run some command with Cordova, the NodeJs output is:
Error of type [ERR_INVALID_ARG_TYPE]: ...
After fixing the code in this line:
<plugin name="cordova-plugin-someplugin" />
every other cordova command now seems to work correctly!!
The example project does not build for me, it stops at "run ios":
# cordova run ios
cordova-custom-config: Skipping auto-restore of config file backup(s)
Overwriting existing resource file at platforms/ios/FirebaseTest/Resources/res/ios/sound/blackberry.caf
Overwriting existing resource file at platforms/ios/FirebaseTest/Resources/res/ios/sound/crystal.caf
Overwriting existing resource file at platforms/ios/FirebaseTest/Resources/res/ios/sound/msn.caf
Overwriting existing resource file at platforms/ios/FirebaseTest/Resources/res/ios/pn-actions.json
cordova-plugin-firebasex: Preparing Firebase on iOS
cordova-plugin-firebasex: cordova-plugin-firebasex: Applied post install block to Podfile
cordova-plugin-firebasex: cordova-plugin-firebasex: Added URL scheme "undefined"
Cannot read properties of undefined (reading 'replace')
This is the output of cordova requirements:
# cordova requirements
Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed 15.2
ios-deploy: installed 1.12.2
CocoaPods: installed 1.15.2
When I am trying to install cordova-plugin-firebasex with cordova android 12, I am getting this error TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('ENOENT')