Android的工具插件摇篮 [英] Android-Tools Gradle Plugin

查看:136
本文介绍了Android的工具插件摇篮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在试图获得新的构建系统为Android(<一个href=\"http://tools.android.com/tech-docs/new-build-system/using-the-new-build-system\">http://tools.android.com/tech-docs/new-build-system/using-the-new-build-system) 。上班所以我创建了以下内容的的build.gradle 文件:

I am currently trying to get the new build system for android (http://tools.android.com/tech-docs/new-build-system/using-the-new-build-system) to work. Therefore 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've done this based on the docs, so I expect it to work; however, I get the following error message:

错误:默认的配置对Android的间接依赖
  API级别14,但为的minSdkVersion变种'调试'是API级别8

ERROR: The default configuration has an indirect dependency on Android API level 14, but minSdkVersion for variant 'Debug' is API level 8

在删除在Android 4.0.1.2的显式依赖,错误消失,但我留下编译错误,因为Android的文件本身不能得到解决。作为一个例子,活动查看如类无法找到。按说,我可以降级到旧版Android匹配的minSdkVersion ,但我想编译反对SDK 15 用最少的 8

When removing the explicit dependency on android 4.0.1.2, the error vanishes but I am left with compile errors because Android files themselves cannot be resolved. As an example, Activity or View as classes cannot be found. Supposedly, I could downgrade to an older version of Android to match the minSdkVersion, but I want to compile against sdk 15 with a minimum of 8.

插件本身是宣布根的build.gradle 0.3版本。

The plugin itself is declared in a root build.gradle with version 0.3.

有你们任何人有一个想法如何解决这个错误?

Has anyone of you got an idea how to resolve that error?

谢谢,
马蒂亚斯

Thanks, Matthias

推荐答案

HM不知何故,我得到这个使用支持的API,而不是完整的Andr​​oid作为依赖工作......至少现在的工作......

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

这篇关于Android的工具插件摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆