Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-toos/aapt2 issue with gradle in android termux #35

Open
amsitlab opened this issue Jan 3, 2024 · 1 comment
Open

build-toos/aapt2 issue with gradle in android termux #35

amsitlab opened this issue Jan 3, 2024 · 1 comment

Comments

@amsitlab
Copy link

amsitlab commented Jan 3, 2024

If we use gradle build tools in termux (android) to build android apps,
android-sdk build-tools/<version>/aapt2 is unused
cause android gradle plugin (AGP) will auto download and use aapt2 from https://maven.google.com/web/m_index.html#com.android.tools.build:aapt2
and that will produce an error in termux
because downloaded file contains executable for linux and not compatible for termux

current solution:

  • use maven local repository in all build.gradle
  • convert all jar file in ~/.gradle/cache/modules-2/files-1/ to maven local repository format by using this script (without finalizedBy)
  • run gradle cacheToMavenLocal
  • replace executable aapt2 in .m2/repository/com/android/tools/build/aapt2/< version >/aapt2-< version >.jar (downloaded by AGP from here ) with aapt2 provided by termux
  • and rebuild gradle assembleDebug
@lzhiyong
Copy link
Owner

lzhiyong commented Jan 3, 2024

please refer to build-app readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants