1

After updating my canary 5 to 6, my projects syncs but won't build, both on Windows 10 and Mac iOS 10.13.2

android {
    compileSdkVersion 27
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId "com.test"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            postprocessing {
                removeUnusedCode false
                removeUnusedResources false
                obfuscate false
                optimizeCode false
                proguardFile 'proguard-rules.pro'
            }
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.android.support:support-vector-drawable:27.0.2'
}

-- wrapper.properties

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-rc-3-all.zip

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0-alpha06'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Build failed: AAPT2 error: check logs for details

under "run Tasks"

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)...

What can be the issue? Thanks

AeonDave
  • 781
  • 1
  • 8
  • 17
  • Check Gradle Console, there it should show something related to app resources failing the build(AAPT error signifies something wrong with resources). – Demonick Jan 04 '18 at 14:05
  • i tried with removing ALL resources and re-add, resulting with the same. i tried with a new compiling project, adding some res (layout, xml) ending with this same error again and again, even removing them. With the stable version works so i guess this version is bugged and still too unripe. – AeonDave Jan 04 '18 at 14:25
  • Also build tools version could impact it, 26.0.2 seems to be the most stable at this moment. – Demonick Jan 04 '18 at 16:09
  • @Demonick , are you suggesting we use build tools version `26.0.2` over the newer ones (the newest being `27.0.3`)? I too am facing a similar AAPT2 error -- invalid file path. BUT only on my Jenkin’s build server, when building a release version of a library project. I’m not running into any issues locally on my machine (AndroidStudio version 3.0.1, gradle Android plugin 3.0.1, build tools version 27.0.3). – Sakiboy Jan 05 '18 at 07:04
  • 1
    @Sakiboy sometimes reverting build tools version fixes build failures, but also could try aligning build tools version 27.x to be of same base version as support libraries 27.x – Demonick Jan 05 '18 at 07:26
  • Ok, I'll try reverting to `27.0.2` of the build tools since that's the current support library version. Thanks. – Sakiboy Jan 05 '18 at 07:31
  • @AeonDave Check the Gradle Console, you should have the real AAPT errors just above the stacktrace. – Izabela Orlowska Jan 05 '18 at 16:10
  • i don't really know.. if i use AS 3.0.1 all works fine with 27.0.3 built tools. i guess is the canary that is broken – AeonDave Jan 05 '18 at 22:34
  • @AeonDave Can you post the errors that should appear above the stack trace? Without it we cannot identify the issue. – Izabela Orlowska Jan 09 '18 at 11:46
  • @Izabela Orlowska that's the stack trace in logcat from AS window. nothing more, nothing less. i just cut the tail of useless and repetitive contents – AeonDave Jan 10 '18 at 12:29
  • @AeonDave This is a part of the stack trace from the build. Can you either post the whole thing from Gradle Console or run "./gradlew clean :app:processDebugResources" and post the whole output here? – Izabela Orlowska Jan 11 '18 at 15:21

0 Answers0