com.android.ide.common.process.ProcessException: Failed to execute aapt error

Any ideas what’s causing this:

UATHelper: Packaging (Android (ETC2)): :downloader_library:processDebugResources
UATHelper: Packaging (Android (ETC2)): C:\Users\Feureau-PC\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\f0e8b037e021186812730081e49f0b9c\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontStyle not found.
UATHelper: Packaging (Android (ETC2)): C:\Users\Feureau-PC\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\f0e8b037e021186812730081e49f0b9c\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/font not found.
UATHelper: Packaging (Android (ETC2)): C:\Users\Feureau-PC\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\f0e8b037e021186812730081e49f0b9c\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontWeight not found.
UATHelper: Packaging (Android (ETC2)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:95: error: resource android:attr/fontStyle not found.
UATHelper: Packaging (Android (ETC2)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:95: error: resource android:attr/font not found.
UATHelper: Packaging (Android (ETC2)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:95: error: resource android:attr/fontWeight not found.
UATHelper: Packaging (Android (ETC2)): error: failed linking references.
PackagingResults: Error: resource android:attr/fontStyle not found.
PackagingResults: Error: resource android:attr/font not found.
PackagingResults: Error: resource android:attr/fontWeight not found.
PackagingResults: Error: resource android:attr/fontStyle not found.
PackagingResults: Error: resource android:attr/font not found.
PackagingResults: Error: resource android:attr/fontWeight not found.
PackagingResults: Error: failed linking references.
UATHelper: Packaging (Android (ETC2)): Failed to execute aapt
UATHelper: Packaging (Android (ETC2)): com.android.ide.common.process.ProcessException: Failed to execute aapt
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
UATHelper: Packaging (Android (ETC2)):     at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
UATHelper: Packaging (Android (ETC2)):     at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
UATHelper: Packaging (Android (ETC2)):     at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
UATHelper: Packaging (Android (ETC2)):     at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
UATHelper: Packaging (Android (ETC2)):     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
UATHelper: Packaging (Android (ETC2)):     at java.lang.reflect.Method.invoke(Method.java:498)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
UATHelper: Packaging (Android (ETC2)):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
UATHelper: Packaging (Android (ETC2)):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
UATHelper: Packaging (Android (ETC2)):     at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
UATHelper: Packaging (Android (ETC2)):     at java.lang.Thread.run(Thread.java:745)
UATHelper: Packaging (Android (ETC2)): Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
UATHelper: Packaging (Android (ETC2)): :app:processDebugResources FAILED
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
UATHelper: Packaging (Android (ETC2)):     ... 47 more
UATHelper: Packaging (Android (ETC2)): Caused by: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
UATHelper: Packaging (Android (ETC2)):     at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$makeValidatedPackage$1(QueueableAapt2.java:179)
UATHelper: Packaging (Android (ETC2)):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
UATHelper: Packaging (Android (ETC2)):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
UATHelper: Packaging (Android (ETC2)):     ... 1 more
UATHelper: Packaging (Android (ETC2)): Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:463)
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:415)
UATHelper: Packaging (Android (ETC2)):     at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:332)
UATHelper: Packaging (Android (ETC2)):     at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)
UATHelper: Packaging (Android (ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ETC2)): * What went wrong:
UATHelper: Packaging (Android (ETC2)): Execution failed for task ':app:processDebugResources'.
UATHelper: Packaging (Android (ETC2)): > Failed to execute aapt
UATHelper: Packaging (Android (ETC2)): * Try:
UATHelper: Packaging (Android (ETC2)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
UATHelper: Packaging (Android (ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ETC2)): BUILD FAILED in 43s
UATHelper: Packaging (Android (ETC2)): 55 actionable tasks: 55 executed
PackagingResults: Error: check logs for details
PackagingResults: Error: check logs for details
PackagingResults: Error: check logs for details
UATHelper: Packaging (Android (ETC2)): ERROR: cmd.exe failed with args /c "c:\Users\Feureau-PC\Desktop\MyProject\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (ETC2)):        (see C:\Users\Feureau-PC\AppData\Roaming\Unreal Engine\AutomationTool\Logs\c+Program+Files+Epic+Games+UE_4.21\Log.txt for full exception trace)
PackagingResults: Error: cmd.exe failed with args /c "c:\Users\Feureau-PC\Desktop\MyProject\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error

No clue really. Having the same problem Launching to my device. Going to assume Gradle’s the issue :slight_smile: Going to try to use Ant and see if that works.

Yeah - this issue has been around since preview, still exists in the release.

For this particular issue, it’s especially arcane. In addition to the steps you mention, Feureau, I have removed all NVPACK and Android installations (such as Android Studio), cleared all android related directories under my home folder, used the SDK Manager (another example of out of date documentation) to verify available SDKs, then installed on a second machine and run everything through where it can build. So there is clearly something in particular missing in the Android documentation, but I’ve not yet managed to track down whatever the minor difference between these machines is, though I have ruled out SDKs, temporary and intermediate files, engine versions etc. Though the machine that’s failing also has a source build of UE4 there, but that’s not the one being used. All that I can think of remaining to investigate is registry keys, though I can’t imagine Android would be using those in any form because it’s cross platform.

If I ever manage to find it out, I’ll post here, but, after years using UE4 on side projects, I’m finding this kind of slop is the single largest individual item in terms of my time. Working like this is not at all tenable for something which frames itself to be professional software, and the lack of response to any challenging issue speaks volumes.

Cheers,

Alan.

This issue seems to be specific to 4.21

Solution is to go to Project Settings > Platforms > Android SDK and set SDK API Level and NDK API Level both to ‘latest’.

You also need to have CodeWorksforAndroid-1R7u1-windows installed. If you have android studio or anything else that uses android, don’t put updates on the same folder. UE needs the exact versions in 1R7u1

Hi Feureau,

Yeah, it’s definitely specific to 4.21, though I had exactly the same code across two machines. One works, one doesn’t.

I had the SDK API Level set to matchndk, and the ndk to latest, unclear why this didn’t work, but switching the SDK API level to latest resolved it on the machine it was failing on. (Haven’t checked if it still works on the other one)

Thanks for sharing the fix. I’d lost days to this with no end in sight.

Cheers,

Alan.

Thanks a bunch! I had the exact same problem when I switched to UE4.21 and after a couple of hours fighting with this I was running out of ideas.

UATHelper: Packaging (Android (ASTC)): [homedir].gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\33985f4c7c6fbda98d54cbf61ffb3b9e\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontStyle not found.
UATHelper: Packaging (Android (ASTC)): [homedir].gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\33985f4c7c6fbda98d54cbf61ffb3b9e\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/font not found.
UATHelper: Packaging (Android (ASTC)): [homedir].gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\33985f4c7c6fbda98d54cbf61ffb3b9e\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontWeight not found.
UATHelper: Packaging (Android (ASTC)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:94: error: resource android:attr/fontStyle not found.
UATHelper: Packaging (Android (ASTC)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:94: error: resource android:attr/font not found.
UATHelper: Packaging (Android (ASTC)): Z:\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:94: error: resource android:attr/fontWeight not found.
UATHelper: Packaging (Android (ASTC)): error: failed linking references.

The error appeared while packaging for Android with the SDK API evel set to matchndk and the NDK API level to latest.

After setting both the android SDK and NDK API levels to latest, the build was successful.

Will also confirm that setting both the SDK and NDK in the Android SDK project settings fixed this error for me. Thank you!

Will also add that this is a 4.21 exclusive issue from my own internal testing.

i had the same problem and this answer did fix it. Thanks Feureau