Android Tools Gradle Plugin

I'm currently trying to get a new build system for Android ( http://tools.android.com/tech-docs/new-build-system/using-the-new-build-system ). So I created a build.gradle file with the following contents:

 apply plugin: 'android' android { compileSdkVersion 15 target='android-15' defaultConfig { targetSdkVersion 15 minSdkVersion 8 versionCode 10 } sourceSets { main { manifest { srcFile 'AndroidManifest.xml' } } } } repositories { mavenCentral() } dependencies { compile 'com.google.android:android:4.0.1.2' compile project(':ActionBarSherlock') compile fileTree(dir: './libs', include: '*.jar') } 

I did it based on documents, so I expect it to work; however, I get the following error message:

ERROR. The default configuration is indirectly dependent on Android API 14, but minSdkVersion for the Debug option is API level 8

When you remove the explicit dependency on android 4.0.1.2, the error disappears, but I remain with compilation errors because the Android files themselves cannot be resolved. For example, Activity or View as classes cannot be found. Presumably, I could upgrade to an earlier version of Android to match minSdkVersion , but I want to compile with sdk 15 with a minimum value of 8 .

The plugin itself is declared in the root assembly with version 0.3.

Do any of you understand how to solve this error?

Thanks Matthias

+6
source share
1 answer

Hm somehow I got this to work using the support API and not the whole Android as a dependency ... at least it works now ...

+4
source

All Articles