更新android studio 3.0之后无法建立专案 [英] After updating android studio 3.0 unable to build the project

查看:87
本文介绍了更新android studio 3.0之后无法建立专案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android.enableAapt2 = false添加到gradle.properties的底部
gradle.properties

android.enableAapt2=false added at the bottom of gradle.properties
gradle.properties

http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    android.enableAapt2=false

build.gradle 将sdk工具更新到26版本后更新了gradle文件 sdk工具是最新的

build.gradle Updated the gradle file after updating sdk tool to 26 version sdk tool is upto date

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.example.madhural.myapplication"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.tarek360.RichPath:animator:0.0.9'
    compile 'com.github.mmoamenn:LuckyWheel_Android:0.0.2'
    compile 'com.google.code.gson:gson:2.6.1'
    testCompile 'junit:junit:4.12'
}

构建完成后出现波纹错误

getting bellow error after build complete

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
Error:No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').
Error:No resource found that matches the given name (at 'roundIcon' with value '@mipmap/ic_launcher_round').
Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').
Error:No resource found that matches the given name (at 'roundIcon' with value '@mipmap/ic_launcher_round').
Error:No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\amin.p\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\amin.p\AppData\Local\Android\Sdk\platforms\android-26\android.jar -M \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\res\merged\debug -m -J \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\generated\source\r\debug -F D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.example.madhural.myapplication -0 apk --output-text-symbols \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\symbols\debug --no-version-vectors}
Error:com.android.ide.common.process.ProcessException: Error while executing process C:\Users\amin.p\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\amin.p\AppData\Local\Android\Sdk\platforms\android-26\android.jar -M \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\res\merged\debug -m -J \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\generated\source\r\debug -F D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\res\debug\resources-debug.ap_ --custom-package com.example.madhural.myapplication -0 apk --output-text-symbols \\?\D:\Gamify Your World\GamifyYourWorld\GYWGameApp\app\build\intermediates\symbols\debug --no-version-vectors}
Error:org.gradle.process.internal.ExecException: Process 'command 'C:\Users\amin.p\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe'' finished with non-zero exit value 1
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 13s
Information:10 errors
Information:0 warnings
Information:See complete output in console

推荐答案

我遇到了同样的问题:错误:任务':app:processDebugResources'的执行失败.

I was facing the same issue: Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'command'C:\ Development \ Android \ Sdk \ build-tools \ 26.0.2 \ aapt.exe' '以非零退出值1结尾

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Development\Android\Sdk\build-tools\26.0.2\aapt.exe'' finished with non-zero exit value 1

此问题是由于以下原因造成的:我在style.xml中声明了可样式化,这是不正确的.

This problem is due to this: I have declared the stylable in the style.xml which is not correct.

<!--<declare-styleable name="mapStyle"><attr name="layout_width"/><attr name="layout_height"/><attr name="layout_weight"/></declare-styleable>-->

当我发表评论时,它可以正常工作. 因此,请检查您的style.xml.

When I comment it then it works fine. so check your style.xml.

这篇关于更新android studio 3.0之后无法建立专案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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