2016-05-11 39 views
0

我可以運行該項目 但我發現,如果我增加多少文件,當我生成項目,機器人工作室將顯示錯誤 這是錯誤資產文件太多會導致錯誤?

Information:Gradle tasks [:app:assembleRelease] :app:preBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:checkReleaseManifest :app:preDebugBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE :app:prepareComAndroidSupportDesign2311Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE :app:prepareReleaseDependencies :app:compileReleaseAidl :app:compileReleaseRenderscript :app:generateReleaseBuildConfig :app:mergeReleaseShaders :app:compileReleaseShaders :app:generateReleaseAssets :app:mergeReleaseAssets :app:generateReleaseResValues UP-TO-DATE :app:generateReleaseResources :app:mergeReleaseResources :app:processReleaseManifest :app:processReleaseResources FAILED Error:Execution failed for task ':app:processReleaseResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\k03\AppData\Local\Android\sdk\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1

我嘗試clean projectrebuild project,但仍表現出同樣的錯誤

這是gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 
    useLibrary 'org.apache.http.legacy' 

    defaultConfig { 
     applicationId "com.example.k03.vv" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.3.0' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.google.code.gson:gson:2.5' 
} 
+0

請確保'build.gradle文件中的目標sdk版本'必須與您安裝的sdk版本匹配。 –

+0

我檢查了'tools> android> SDK Manager',我已經安裝了所有的構建工具和api – user5509470

+0

,我嘗試從資產中刪除該文件,然後清理項目並構建項目,這是成功構建 – user5509470

回答

0

我以前見過這個問題。通常,原因是您的某些資產不符合Android Studio的規範。嘗試批量添加資產,並在每次後都做clean project。然後找到不合適的並修復它。

希望有幫助。

+0

謝謝!我發現問題文件!難怪許多失敗的嘗試 – user5509470

相關問題