You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/08/18 15:46:02 UTC

[GitHub] [cordova-android] YoannRu opened a new issue, #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

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

   Hi,
   
   I try to migrate to cordova-android@11.0.0
   
   I follow this [tutorial](https://ionic.zendesk.com/hc/en-us/articles/7891143965975-Migrating-to-Cordova-Android-11).
   
   When i run Android Studio, the build fails with this error : 
   
   
   ```
   FAILURE: Build failed with an exception.
   
   * Where:
   Build file '[...]/platforms/android/app/build.gradle' line: 20
   
   * What went wrong:
   A problem occurred evaluating project ':app'.
   
   Failed to apply plugin 'com.android.internal.version-check'.
      Minimum supported Gradle version is 7.3.3. Current version is 7.1. If using the gradle wrapper, try editing the distributionUrl in [...]/platforms/android/gradle/wrapper/gradle-wrapper.properties to gradle-7.3.3-all.zip
   
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
   
   * Get more help at https://help.gradle.org
   
   BUILD FAILED in 3s
   ```
   
   I tried to follow the different answers of this [stackoverflow thread](https://stackoverflow.com/questions/72270770/update-to-android-studio-chimpmunk-minimum-supported-gradle-version-is-7-3-3) but nothing worked.
   (I have no file called 'gradle-wrapper.properties', i tried to create one and change distributionUrl, but nothing changed)
   
   You can find my config here : 
   
   ```
   
   Ionic:
   
      Ionic CLI          : 6.17.1 (/usr/local/lib/node_modules/@ionic/cli)
      Ionic Framework    : ionic-angular 3.9.5
      @ionic/app-scripts : 3.2.3
   
   Cordova:
   
      Cordova CLI       : 11.0.0
      Cordova Platforms : android 11.0.0, ios 6.2.0
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 31 other plugins)
   
   Utility:
   
      cordova-res                          : not installed globally
      native-run (update available: 1.6.0) : 1.0.0
   
   System:
   
      NodeJS : v13.14.0 (/usr/local/bin/node)
      npm    : 6.14.4
      OS     : macOS Monterey
   
   ```
   
   Thanks in advance 🙏
   
   


-- 
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


[GitHub] [cordova-android] YoannRu commented on issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

Posted by GitBox <gi...@apache.org>.
YoannRu commented on issue #1477:
URL: https://github.com/apache/cordova-android/issues/1477#issuecomment-1220815397

   I created a new cordova project with `cordova create testapp`.
   And during the build I got this error : 
   
   ```
   Checking Java JDK and Android SDK versions
   ANDROID_HOME=undefined (recommended setting)
   ANDROID_SDK_ROOT=undefined(DEPRECATED)
   Using Android SDK: undefined
   Could not find an installed version of Gradle either in Android Studio,
   or on your system to install the gradle wrapper. Please include gradle
   in your path, or install Android Studio
   ```
   
   So i run : ` brew install gradle`
   
   And that's work (now i have other error related to android:exported & oneSignal plugin 😅).
   
   I don't understand why Android Studio doesn't install gradle. 
   
   Thank you so much for your help and time.
   
   Best regards
   
   


-- 
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


[GitHub] [cordova-android] breautek commented on issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1477:
URL: https://github.com/apache/cordova-android/issues/1477#issuecomment-1220662060

   > About the first point I do not have a file in ~/.gradle/gradle.properties
   
   Good, by default this file does not exists, but if it does, it will be used as user-level settings for gradle.
   
   > I tried to build with node 14.X, same issue. Unfortunately, i can't use Node 16.X cause of node-sass and ionic 3.X
   
   :+1: 14.x should be fine. Just one additional note, I'd use the latest patch available within 14.x. Which is I believe is currently `14.20.0`
   
   > And I need to create a local.properties with the sdk.dir variable in it ([issue](https://stackoverflow.com/questions/67398608/unable-to-determine-android-sdk))
   
   This would be the Gradle way of defining where the Android SDK is. Cordova will read from the `ANDROID_HOME` and `ANDROID_SDK_HOME` environment variables and should set the required variables in the android studio project accordingly. But either way should work.
   
   I see that you're using ionic. To rule out that something inside inside ionic is causing the issue, I'd try building a test app without ionic.
   
   The following commands will create a pure "Hello Cordova" cordova project with cordova-android@11 and build/run it on a simulator or usb device.
   ```
   cordova create testapp
   cd testapp
   cordova platform add android@11
   cordova build android
   cordova run android
   ```
   
   You could also try the same thing with by simply adding ionic (however you do that, I'm not very familiar with ionic) to see if the issue reproduces with a simple ionic app.
   
   If the issue only reproduces with ionic, then it would suggest the issue is somewheres within the ionic codebase, which might be overwriting Cordova's configured gradle settings. If it does reproduce in the pure cordova hello world app, then we now have a simple app that shows something isn't configured correctly and we can work from there.


-- 
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


[GitHub] [cordova-android] YoannRu commented on issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

Posted by GitBox <gi...@apache.org>.
YoannRu commented on issue #1477:
URL: https://github.com/apache/cordova-android/issues/1477#issuecomment-1220514222

   First of all thank you for your help and the time you took to answer me @breautek.
   
   I tried to build with node 14.X, same issue. Unfortunately, i can't use Node 16.X cause of node-sass and ionic 3.X
   
   I confirm that each change I made, I executed these 3 commands :
   
   ```
   $ ionic cordova platform rm android
   $ ionic cordova platform add android@11
   $ ionic cordova platform prepare android
   ```
   
   About the first point I do not have a file in `~/.gradle/gradle.properties`
   ```
   .tmp	
   daemon
   native
   wrapper
   caches
   jdks
   notifications
   ``` 
   
   Same in my `config.xml`, nothing with gradle.
   
   I check my `cdv-gradle-config.json`, and everything looks ok :
   
   ```
   {
     "MIN_SDK_VERSION": 15,
     "SDK_VERSION": 32,
     "COMPILE_SDK_VERSION": null,
     "GRADLE_VERSION": "7.4.2",
     "MIN_BUILD_TOOLS_VERSION": "32.0.0",
     "AGP_VERSION": "7.2.1",
     "KOTLIN_VERSION": "1.5.21",
     "ANDROIDX_APP_COMPAT_VERSION": "1.4.2",
     "ANDROIDX_WEBKIT_VERSION": "1.4.0",
     "ANDROIDX_CORE_SPLASHSCREEN_VERSION": "1.0.0-rc01",
     "GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.3.10",
     "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": false,
     "IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false
   }
   ```
   
   In in `project/platform/android/.gradle` I've got this files : 
   
   ```
   .gradle
   ├── 7.1
   │   ├── dependencies-accessors
   │   │   ├── dependencies-accessors.lock
   │   │   └── gc.properties
   │   ├── fileChanges
   │   │   └── last-build.bin
   │   ├── fileHashes
   │   │   └── fileHashes.lock
   │   ├── gc.properties
   │   └── vcsMetadata-1
   ├── checksums
   │   └── checksums.lock
   └── vcs-1
       └── gc.properties
   ```
   
   
   Another thing that might help, whenever `cordova platform add android@11` I got this erreur :
   
   ```
   FAILURE: Build failed with an exception.
   
   * Where:
   Script '[...]/platforms/android/CordovaLib/cordova.gradle' line: 114
   
   * What went wrong:
   A problem occurred evaluating script.
   > Unable to determine Android SDK directory.
   
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
   
   * Get more help at https://help.gradle.org
   
   BUILD FAILED in 3s
   
   ```
   
   And I need to create a local.properties with the sdk.dir variable in it ([issue](https://stackoverflow.com/questions/67398608/unable-to-determine-android-sdk))
   
   If you need any other information, don't hesitate to ask me.
   
   Thanks again for your help.
   
   


-- 
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


[GitHub] [cordova-android] YoannRu closed issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

Posted by GitBox <gi...@apache.org>.
YoannRu closed issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.
URL: https://github.com/apache/cordova-android/issues/1477


-- 
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


[GitHub] [cordova-android] breautek commented on issue #1477: Minimum supported Gradle version is 7.3.3. Current version is 7.1.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1477:
URL: https://github.com/apache/cordova-android/issues/1477#issuecomment-1219713835

   Here are some things you can try...
   
   #### Make sure you're not overriding the gradle version. cordova-android@11 by default uses Gradle 7.4.2, and usually there is no need to use a gradle version other than what cordova configures by default.
   
   Common overwrites may come from:
   - `distributionUrl` setting inside `~/.gradle/gradle.properties`
   - `GradleVersion` preference inside `config.xml`
   
   #### Cordova minimum supported NodeJS is 14.x
   
   >  NodeJS : v13.14.0 (/usr/local/bin/node)
   
   Might not be related to this issue, but Cordova doesn't support any odd releases (13.x, 15.x, 17.x, etc) as these are bleeding edge test releases that are short lived. They may or may not work. It's always recommended to use the LTS releases which are always the even numbers (14.x, 16.x, etc).
   
   Currently the minimum supported Node version is 14.x, but it's recommended to use NodeJS 16.
   
   ####  In-place upgrades aren't supported.
   
   So when migrating from an older version of cordova-android to a newer version, you usually have to delete/wipe/run `cordova platform remove android` and then re-add the android platform using `cordova platform add android@11`. Simply updating the cordova-android NPM dependency will not work.
   
   Let me know if any of these things helps.


-- 
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