2014-07-22 210 views
4

我嘗試升級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

問題已解決了我:

我不得不做出canges在這些線路。

的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工作室最新版本,先更新它。

如果你沒有解決,試試這個。

+0

變化究竟是什麼?你可以請你突出你的build.gradle中的變化嗎?謝謝 – Ahmed

+0

@Ahmed更新sdk到20 W後,我將依賴關係升級到0.11到0.12,並將compileSdkVersion&buildToolsVersion升級到20,並將appcompat和support升級到20. – sherin

+0

我嘗試了同樣的方法,但它對我無效。它無法找到20,因爲在sdk - > buildtools文件夾下20 W文件夾名稱不同。即android 4.4W,這是無法識別的。你能分享一下你在sdk-> buildtools文件夾中的最後一個buildtool的名字嗎? – Ahmed

相關問題