Closed pedro21900 closed 7 months ago
cordova-android@10 is out of support. The current version is cordova-android@12, which uses API 33, which is what is required to deploy to Google Play. So the first thing I'd try is try to use cordova-android@12 instead of 10.
If you still see ENOENT: no such file or directory, mkdir 'platforms/android/app/src/main'
it suggest that the folder structure isn't being generated as expected. To remove influence from frameworks, I'd try to see if you can reproduce the issue in a sample cordova app without the use of frameworks.
cordova create testapp
cd testapp
cordova platform add android@12 --verbose
If it fails, please post the output of the cordova platform add android@12 --verbose
command.
If it works successfully, then it suggests an issue inside the Ionic CLI.
Please let me know what is found.
após uma tentativa utilizando "cordova platform add android@12 --verbose"
I got the following error
node version v10.9.0 angular 8 ionic 4
No scripts found for hook "before_platform_add". Using cordova-fetch for cordova-android@12 fetch: Installing cordova-android@12 to /home/xxxxx/git/xxx-app/02_fontes Running command: npm install cordova-android@12 --production --save Command finished with error code 0: npm install,cordova-android@12,--production,--save Removing "cordova-" prefix from cordova-android Adding android project... Unable to load PlatformApi from platform. SyntaxError: Unexpected token . Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.) Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.) at CordovaEventEmitter.emit (events.js:171:17) at CordovaEventEmitter.emit (/home/lenonn/.nvm/versions/node/v10.9.0/lib/node_modules/cordova/node_modules/cordova-common/src/events.js:69:22) at Object.getPlatformApiFunction (/home/xxxxx/.nvm/versions/node/v10.9.0/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:384:20) at /home/xxxxx/.nvm/versions/node/v10.9.0/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:181:52
node version v10.9.0
This isn't a supported Node Version. Current LTS is recommended (Node 18), but at minimum you'll need NodeJS 16.13.0
Closing as not a bug.
Thank you very much for the information, thanks to your help I was able to carry out the update, of course I also have to update the plugins, but thanks to your help I am using API 33
No matter what I do or what I update I always come back to this error and I need to update the project to deploy in the play store