ERROR:AAPT: unknown option '--source-path'
I am using Gradle 7.2, Android Gradle Plugin 7.0.1, and JDK17 in Termux Android
In your repo, I downloaded appt2 Android 11(for arch) as replacement in my existing aapt2.
Upon building using "gradle build", it was successful. But after adding any androidx dependency, it failed with the error below:
`AAPT2 aapt2-7.0.1-7396180-linux Daemon #0: shutdown
AAPT2 aapt2-7.0.1-7396180-linux Daemon #1: shutdown
FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
Android resource compilation failed ERROR:AAPT: unknown option '--source-path'.`
Seems like aapt2 does not support --source-path option Can you please add new option?
Hi @arcans , would you mind pasting the entire command that gradle is executing? Thanks!
gradle assembleDebug
It's because the aapt2 binary is outdated with the AGP version you're using.
Me also getting this error
I'm also getting this error on Newer projects. Using old Projects with old gradlew versions work in some projects.
I really have no idea of how to build a new version of aapt2 like for andrid 12/13.
@JonForShort Can u Save us building a new version?
Hi @victorwads , I am sorry but I haven't had much time to dedicate to this project.
If you'd like to try building the binaries yourself, please take a look at the modifications I have made to the AOSP build scripts (https://github.com/JonForShort/android-tools/tree/master/patch). For Android 12 and 13, you will most likely need to make similar changes.
If you haven't ever built the AOSP project, you should get familiar with this process first (https://source.android.com/setup/build).