fudom opened a new issue, #1731:
URL: https://github.com/apache/cordova-android/issues/1731

   # Bug Report
   
   ## Problem
   
   When I run a cordova build on a fresh git cloned project, after npm install, 
the following error occurs:
   
   ```
   Failed to install 'cordova-plugin-statusbar': 
     Error: C:\path-to-app\platforms\android\cdv-gradle-config.json: ENOENT: no 
such file or directory, 
     open 'C:\path-to-app\platforms\android\cdv-gradle-config.json'
   ```
   
   My workaround, is adding a pre build script which adds the platform again:
   
   ```js
   if (!existsSync('platforms/android/android.json')) {
     const cordovaAndroidVersion = devDependencies['cordova-android'];
     execSync(`cordova platform add android@${cordovaAndroidVersion}`, { stdio: 
'inherit' });
   }
   ```
   
   But then, sometimes the following error appears:
   
   ```
   CordovaError: Platform android already added.
     at 
C:\path-to-app\node_modules\cordova-lib\src\cordova\platform\addHelper.js:120:35
   ```
   
   ### Command or Code
   
   ```
   cordova build android --release
   ```
   
   I think we should ensure that the platform incl. folder structure exists on 
npm i or cordova build. Because it's already defined in package.json.
   
   ### Environment, Platform, Device
   
   Windows 11, Node 20.14, cordova-android 13
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to