5

When you reassemble the application again via Apktool, this error occurs. What is the solution?

 Log For : app.apk 

 Log Type : Recompiling 

 Log Recorded At : Sat 10-08-2019 12:07:17.06 


------------------------------------------------------ 
------------------------------------------------------ 

brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515): [C:\Users\MC\AppData\Local\Temp\brut_util_Jar_6951838926850516236.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 28, --version-code, 452877, --version-name, 2.19.203, --no-version-vectors, -F, C:\Users\MC\AppData\Local\Temp\APKTOOL396430661739840676.tmp, -0, arsc, -0, png, -0, wav, -0, m4a, -0, mp4, -0, arsc, -I, HELPER\Frameworks\1.apk, -S, C:\Users\MC\Desktop\apktool\MODDING\app.apk\res, -M, C:\Users\MC\Desktop\apktool\MODDING\app.apk\AndroidManifest.xml]

------------------------------------------------------ 
------------------------------------------------------
Michael H.
  • 3,323
  • 2
  • 23
  • 31
  • 1
    This could be helpful https://github.com/iBotPeaches/Apktool/issues/1870#issuecomment-423239077 – unloco Jan 13 '20 at 13:10
  • 3
    Also try this before rebuilding `apktool empty-framework-dir` – unloco Jan 13 '20 at 13:12
  • @unloco That looks like the correct answer. Do you want to post it as a proper answer? – user202729 Dec 12 '20 at 15:43
  • @user202729 it's been awhile, I forgot about this issue, if you'd like, you can post the answer with the adequate explanation, cheers – unloco Dec 12 '20 at 20:55
  • 1
    See also: [recompile - apktool build apk fails - Stack Overflow](https://stackoverflow.com/questions/23317208/apktool-build-apk-fails) – user202729 Dec 15 '20 at 05:49

1 Answers1

14

Because apktool uses aapt internally to package the apk, if the content is incompatible with aapt then apktool will raise the error.

To fix the issue, tell apktool to use aapt2 instead. Example:

apktool b --use-aapt2 -o out.apk directory

Source: GitHub issue comment

user202729
  • 3,358
  • 3
  • 25
  • 36
  • 1
    Note that this is not the only problem that can cause that particular error message. If it doesn't work then check the [linked question](https://stackoverflow.com/questions/23317208/apktool-build-apk-fails) to try other solutions. – user202729 Dec 21 '20 at 09:41