web-dev-qa-db-fra.com

Après la mise à jour d'Android Studio 3.0, impossible de générer le projet.

Android.enableAapt2 = false ajouté au bas de 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 Mis à jour le fichier gradle après la mise à jour de l'outil SDK vers la version 26 L'outil SDK est à jour

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'
}

obtenir l'erreur ci-dessous après la construction complète

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
3
amin pinjari

J'étais confronté au même problème: Erreur: L'exécution a échoué pour la tâche ': app: processDebugResources'.

com.Android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: processus 'commande' C:\Développement\Android\Sdk\outils de construction\26.0.2\aapt.exe '' terminé valeur de sortie non nulle 1

Ce problème est dû à ceci: j'ai déclaré le stylable dans le style.xml qui n'est pas correct.

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

Quand je le commente, alors ça fonctionne très bien ... donc vérifiez votre style.xml.

1
justchill

Vérifiez votre manifeste et les fichiers de style très soigneusement. Il pourrait y avoir des erreurs en eux. Surtout si vous avez créé vos styles personnalisés dans styles.xml.

Après cela Build-> Clean Project, et cela devrait fonctionner

0
shellym