0
votes

When I first was building my Android Cordova app in Android Studio with Gradle 2.2.1, everything was fine.

Then I wanted to be able to also build the app with Cordova CLI, so based on the following document, I enabled Gradle for Cordova CLI: https://github.com/apache/cordova-docs/blob/master/docs/en/edge/guide/platforms/android/tools.md

That broke the build, both in Cordova CLI and in Android Studio, with the error: Could not create plugin of type 'AppPlugin'

The verbose output showed that Cordova downloaded Gradle 1.12 and created a gradle-wrapper.properties file in my project specifying 1.12 distributionUrl. After editing that property back to 2.21, I can build again in Android Studio. But everytime I run the Cordova CLI build, it sets it back to 1.12 and the build fails with the same error.

How do I make Cordova build with Gradle 2.21?

1

1 Answers

-1
votes

I experienced the same problem with the Cordova 4.1.1 build. Looks like it has some configuration set to use old gradle build.

What I did to easy the pain:) is to update android platform up to 4.1.1 with "cordova platform update [email protected]" command. Now it uses gradle 2.2.1 which is much better than 1.2.