FAILURE:构建因异常而失败

时间:2014-07-22 06:48:40

标签: android gradle android-gradle build.gradle

我尝试升级android.support:support。但它显示出一些错误:

    Information:Gradle tasks [:app:generateDebugSources]
    :app:preBuild
    :app:preDebugBuild
    :app:checkDebugManifest
    :app:preReleaseBuild
    :app:prepareComAndroidSupportAppcompatV72100Rc1Library UP-TO-DATE
    :app:prepareComAndroidSupportGridlayoutV71901Library UP-TO-DATE
    :app:prepareComAndroidSupportSupportV42100Rc1Library UP-TO-DATE
    :app:prepareDebugDependencies
    :app:compileDebugAidl UP-TO-DATE
    :app:compileDebugRenderscript UP-TO-DATE
    :app:generateDebugBuildConfig UP-TO-DATE
    :app:generateDebugAssets UP-TO-DATE
    :app:mergeDebugAssets UP-TO-DATE
    :app:generateDebugResValues UP-TO-DATE
    :app:generateDebugResources UP-TO-DATE
    :app:mergeDebugResources
    :app:processDebugManifest
    /home/ti/Projectname/app/src/main/AndroidManifest.xml:0:0 Error:


Error:/home/ti/Projectname/app/src/main/AndroidManifest.xml:0:0 Error:
    uses-sdk:minSdkVersion 11 cannot be smaller than version 11 declared in library com.android.support:support-v4:21.0.0-rc1
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 11 cannot be smaller than version 11 declared in library com.android.support:support-v4:21.0.0-rc1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Information:1 error
Information:0 warnings
Information:See complete output in console

1 个答案:

答案 0 :(得分:1)

问题已经解决了我:

我在这些线上制作了一些小号。

build.gradle

buildscript {
    repositories {
       mavenCentral()
    }
    dependencies {
     classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

android {
   compileSdkVersion 20
   buildToolsVersion '20'

   defaultConfig {
       minSdkVersion 11
       targetSdkVersion 20
       versionCode 6
       versionName "1.1"
   }
   .
   .
   .

 }

dependencies {
  compile 'com.android.support:appcompat-v7:20.+'
  compile 'com.android.support:support-v4:20.+'
  ....
}

注意:如果您没有更新android studio最新版本,请先更新它。

如果你没有解决,请尝试这个。