user1360902
user1360902

Reputation: 37

Having issue with building android APK in ionic

I am building android APK in ionic but getting this error.

Failed to apply plugin [id 'com.android.application'] Minimum supported Gradle version is 4.4. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl

Can anyone please let me know why we are getting this error. Its working fine on browser.

I am using ionic 2.

Upvotes: 0

Views: 102

Answers (2)

Alex Steinberg
Alex Steinberg

Reputation: 1466

To solve these kinds of Ionic build problems in Android, I stick to command line only builds. Try the following:

  1. Remove the platform and relevant folders:

ionic cordova platform rm android

rm -rf platforms

rm -rf plugins

  1. Add the Android platform again

ionic cordova platform add android

  1. DO NOT open Android Studio so that you avoid Gradle and SDK version conflicts. Just do the build:

ionic cordova build android

  1. If there are errors, use verbose error logging. I often have to add executable permissions to some Gradle files, for example.

cordova build android --verbose

Upvotes: 1

Leandro Andrade
Leandro Andrade

Reputation: 7

You need the Android SDK to build an APK file.

Try downloading the latest Android SDK version, remove the Android platform from your project, delete the 'android' folder inside 'platforms' folder and add the Android platform again.

Upvotes: 0

Related Questions