How to get Cordoba to work with Android Studio?

I have the newest, node, npm, android studio, cordova.

I created a new project using

cordova create test cd test cordova platform add android 

I enter Android Studio, import the project, go to test / platform / android, it finds the build.gradle file, works on it for a while, and then spits it out:

 Gradle version 1.10 is required. Current version is 2.2.1 

So, I go to the build.gradle file and update the line

 dependencies { classpath 'com.android.tools.build:gradle:0.10.+' } 

in

  dependencies { classpath 'com.android.tools.build:gradle:0.14.+' } 

And then I re-import my project, it clicks on it several times, and then spits it out:

 Error:failed to find Build Tools revision 19.0.0 

So I install Build Tools 19.0.0

And he tells me:

 Error:The SDK Build Tools revision (19.0.0) is too low for project 'android'. Minimum required is 19.1.0 

So, I look at my SDK manager, and I have installed 19.1.0

So, I return to my build.gradle file:

and I change:

 buildToolsVersion "19.0.0" 

to

 buildToolsVersion "19.1.0" 

And re-import again,

And still telling me: Error. The Build Tools SDK version (19.0.0) is too small for the CordovaLib project. The minimum value is 19.1.0

I am even trying to remove the SDK version 19 tool construct and save 19.1, but it still tells me that.

Can anyone who made this song and dance help me?

+7
android android-studio cordova
source share
4 answers

I had exactly the same problem and I just fixed it. What you need to do is to do the same buildToolsVersion "19.1.0" change the build.gradle file in the CordovaLib folder in the platform project folder, for example. platforms / Android / CordovaLib.

+7
source share

I solved the problem by modifying the gradle file of the App and the gradle file of CordovaLib with the following information:

 changed dependencies { classpath 'com.android.tools.build:gradle:1.1.0+' } } 

and

 android { compileSdkVersion 19 buildToolsVersion "19.1.0" } 

Tested on Android Studio 1.1

+3
source share

I had the same problem. In the end, they selected "Import projects without Android-studio" and switched to the Android android platform. I was not sure if you initially chose the option β€œImport non-Android Studio”.

+1
source share

I had the same problem and I fixed the contents of build.gradle directly in Android Studio (replacing 19.0.0 with 19.1.0). After that, the assembly was successful. Of course, this is only a workaround until the Cordoba team resolves the problem forever. Good luck.

0
source share

All Articles