I am unable to build a gradle project, even if I edit the gradle property, I get the following error:
Error:(22, 1) A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\salangar\angular-cordova-tickrv0.1\platforms\android\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
How do I resolve this?
Cordova-Android requires the Android SDK, which can be installed on either macOS, Linux, or Windows. For the base system requirements, see the Android Studio's System Requirements.
Resolution is simple. Open the "Android SDK Manager", update all packages and then restart your Android Studio. After that you project should compile without any issues.
I was also getting the same error and modifying the
$(your app path)/platform/android/gradle/wrapper/gradle-wrapper.properties to
distributionUrl=http\://services.gradle.org/distributions/gradle-2.10-all.zip
didn't help as it was getting overridden every time i ran cordova build android to 2.2.1
I finally changed the gradleBuilder.js file under $(your app path)/platforms/android/cordova/lib/builders folder.
Search for distributionUrl and change it 2.10.
This triggered download of gradle-2.10 and compilation went through. At least it worked for me.
Instead of manipulating build.js file, the easiet approach would be as follows:
1) Download required gradle version and save it local folder.
2) In command prompt execute the following command:
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=file:///local/path/to/folder/where/gradle/zip/is/saved/gradle-2.2.1-all.zip3) Execute the following command: cordova run android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With