A
A
Andreas St2022-02-07 16:52:38
Apache Cordova
Andreas St, 2022-02-07 16:52:38

Cordova does not build the project from the command line, what should I do?

Has anyone encountered such a problem? - cordova does not build the project because the gradle version is very early.
Thus, the riddle cannot be solved.

Windows 10 Pro system.

Added system environment variables:

GRADLE_ANDROID_HOME=c:\MuGradle\
PATH=%GRADLE_ANDROID_HOME%\bin


Changed in the file:
c:\prj\platforms\android\gradle\wrapper\gradle-wrapper.properties
Parameter:
distributionUrl=https://services.gradle.org/distributions/gradle-7.1.1-all.zip

on the
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip

But after assembly, it automatically returns the old value.

In Android Studio, also, the project properties were opened and the version was 7.3.3.
Menu File -> Project Structure...-> Section Project -> Gradle Version = 7.3.3 ,
Android Studio builds the project, and if through cordova build android or cordova run, do build outputs below error.

PS c:\prj> cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\MyUser\AppData\Local\Android\Sdk\ (recommended setting)
ANDROID_HOME=C:\Users\MyUser\AppData\Local\Android\Sdk\ (DEPRECATED)
Using Android SDK: C:\Users\MyUser\AppData\Local\Android\Sdk
Subproject Path: CordovaLib
Subproject Path: app

FAILURE: Build failed with an exception.

* Where:
Build file 'c:\prj\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.2. Current version is 7.1.1. If using the gradle wrapper, try editing the distributionUrl in c:\prj\platforms\android\gradle\wrapper\gradle-wrapper.properties to gradle-7.2-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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
Command failed with exit code 1: c:\prj\platforms\android\gradlew cdvBuildDebug -b c:\prj\platforms\android\build.gradle

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andreas St, 2022-02-09
@staraday

Add system environment variable:

CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-7.3.3-all.zip

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question