You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "rharrwwis (via GitHub)" <gi...@apache.org> on 2025/07/16 15:20:24 UTC

[I] Missing .gradle/config.properties file [cordova-android]

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

   # Bug Report
   cordova build android keeps failing due to ENOENT: no such file or directory, open 'myapp/platforms/android/tools/.gradle/config.properties' because cordova platform add android@14.0.1 isn't creating the .gradle folder in the tools folder.
   
   
   ## Problem
   platforms/android/tools/.gradle folder is missing after adding android platform which causes build to fail when it tries to open/create the config.properties file.
   
   ### What is expected to happen?
   platforms/android/tools/.gradle folder should be created either during platform add or before config.properties is attempted to be created.
   
   
   ### What does actually happen?
   platforms/android/tools/.gradle folder does not get created causing build to fail when unable to create missing config.properties file.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   This is the code that I added locally in ProjectBuilder.js before the attempt to create config.properties to get my build to succeed:
   // Try to create ".gradle" folder if missing
   const gradleConfigDir = path.dirname(configPropertiesPath);
   if (!fs.existsSync(gradleConfigDir)) {
      fs.mkdirSync(gradleConfigDir, { recursive: true, mode: 0o700 });
   }
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   
   
   ### Version information
   <!--
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   cordova-android 14.0.1
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] 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-unsubscribe@cordova.apache.org.apache.org

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


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


Re: [I] Missing .gradle/config.properties file [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1826:
URL: https://github.com/apache/cordova-android/issues/1826#issuecomment-3079783425

   > It looks like we're using gradle 8.13. We were using 8.14.3, but backed it down to 8.13 when we first encountered the issue. And we're building release for Android SDK 36. It also appears that our Android Gradle Plugin version is 8.7.3 which apparently has not been tested with Android SDK 36.
   
   Cordova prepares the gradle environment based on variables. If you're attempting to manually update the gradle config to use a different gradle wrapper or AGP versions, cordova will reset them the next time it prepares the project. This is because it's honouring the configs (or their defaults) according to the project's `config.xml`
   
   The full config.xml reference can be found [here](https://cordova.apache.org/docs/en/12.x-2025.01/config_ref/index.html) but what you're looking for is the [preferences](https://cordova.apache.org/docs/en/12.x-2025.01/config_ref/index.html#preference) `GradleVersion` and `AndroidGradlePluginVersion`, which will set the gradle wrapper and AGP version respectively.
   
   If you're trying to target SDK 36, then the following preferences will also be helpful:
   - android-buildToolsVersion
   - android-compileSdkVersion
   - android-targetSdkVersion
   
   Note that SDK 36 is not supported by Cordova at this time, and simply updating these preferences may not get you all the way. Often times AGP introduces breaking changes that requires other gradle build script changes. SDK 36 support will be available in the next major release, cordova-android@15, which can be tested by adding the nightly version:
   
   ```
   cordova platform remove android
   cordova platform add android@nightly
   ```
   
   This doesn't appear to be an actual bug. So I'll be closing this issue. If you encounter any issues with nightly however, please do create an issue. It will help us resolve things before the actual release


-- 
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-unsubscribe@cordova.apache.org

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


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


Re: [I] Missing .gradle/config.properties file [cordova-android]

Posted by "rharrwwis (via GitHub)" <gi...@apache.org>.
rharrwwis commented on issue #1826:
URL: https://github.com/apache/cordova-android/issues/1826#issuecomment-3079433202

   It looks like we're using gradle 8.13.  We were using 8.14.3, but backed it down to 8.13 when we first encountered the issue.  And we're building release for Android SDK 36.  It also appears that our Android Gradle Plugin version is 8.7.3 which apparently has not been tested with Android SDK 36.


-- 
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-unsubscribe@cordova.apache.org

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


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


Re: [I] Missing .gradle/config.properties file [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1826:
URL: https://github.com/apache/cordova-android/issues/1826#issuecomment-3079200705

   How are you attempting to build?
   
   `.gradle` is generated by the gradle wrapper, which I believe is invoked during the `prepare` phase (something that is implicitly called when doing a `cordova build`)
   
   ```
   cordova platform add android@14
   Using cordova-fetch for cordova-android@14
   Adding android project...
   Creating Cordova project for the Android platform:
           Path: platforms/android
           Package: io.cordova.hellocordova
           Name: HelloCordova
           Activity: MainActivity
           Android Target SDK: android-35
           Android Compile SDK: 35
   Subproject Path: CordovaLib
   Subproject Path: app
   Android project created with cordova-android@14.0.1
   norman@norman-workstation:/development/cordova/breautek/tests/gtest$ cordova build android
   Checking Java JDK and Android SDK versions
   ANDROID_HOME=/development/tools/Android (recommended setting)
   ANDROID_SDK_ROOT=/development/tools/Android (DEPRECATED)
   Using Android SDK: /development/tools/Android
   Starting a Gradle Daemon (subsequent builds will be faster)
   
   BUILD SUCCESSFUL in 4s
   1 actionable task: 1 executed
   Subproject Path: CordovaLib
   Subproject Path: app
   Starting a Gradle Daemon (subsequent builds will be faster)
   
   > Task :CordovaLib:compileDebugJavaWithJavac
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   [Incubating] Problems report is available at: file:///development/cordova/breautek/tests/gtest/platforms/android/build/reports/problems/problems-report.html
   
   Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
   
   You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
   
   For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
   
   BUILD SUCCESSFUL in 16s
   50 actionable tasks: 50 executed
   Built the following apk(s): 
           /development/cordova/breautek/tests/gtest/platforms/android/app/build/outputs/apk/debug/app-debug.apk
   ```
   
   Freshly added android platform followed by a build doesn't reproduce the issue for me.
   


-- 
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-unsubscribe@cordova.apache.org

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


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


Re: [I] Missing .gradle/config.properties file [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #1826: Missing .gradle/config.properties file
URL: https://github.com/apache/cordova-android/issues/1826


-- 
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-unsubscribe@cordova.apache.org

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


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