Apktool: brut.common.BrutException: could not exec (exit code = -1073741515)

Created on 6 Apr 2019  Â·  14Comments  Â·  Source: iBotPeaches/Apktool

OS: Windows
APK from:
Dynamically generated apk built with phonegap on my computer

Stacktrace:
``````
C:\Users\LJ Germain>apktool b "C:\Users\LJ Germain\RainbowFidgetCloth" -o "C:\Users\LJ Germain\Downloads\RainbowFidgetCloth .apk"
I: Using Apktool 2.4.0
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
S: WARNING: Could not write to (C:\Users\LJ Germain\AppData\Local\apktool\framework), using C:\Users\LJGERM~1\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the defa ult storage directory is unavailable
brut.androlib.AndrolibException: brut.common.BrutException:
could not exec (exit code = -1073741515): [C:\Users\LJGERM~1 \AppData\Local\Temp\brut_util_Jar_6031812586454975601.tmp, p,
--forced-package-id, 127, --min-sdk-version, 26, --version
-code, 10000, --version-name, 1.0.0, --no-version-vectors, -F, C:\Users\LJGERM~1\AppData\Local\Temp\APKTOOL1831151462112
098054.tmp, -0, arsc, -0, png, -0, arsc, -I,
C:\Users\LJGERM~1\AppData\Local\Temp\1.apk, -S, C:\Users\LJ Germain\Rainbow
FidgetCloth\res, -M, C:\Users\LJ Germain\RainbowFidgetCloth\AndroidManifest.xml]

``````
Steps to reproduce
I'm not entirely sure.

Questions to ask before Submission
Are you using the latest version of apktool? Yes.
Have you tried apktool d, apktool b without changing anything? Yes.
If you are trying to install a modified apk, did you resign it? This is my own apk, not modified.

Most helpful comment

I have also seen a few reports of this since updating to 2.4.0.

There seems to be an issue with the 32-bit Windows aapt binary failing to load dependencies.
-1073741515 is actually the HRESULT 0xC0000135‬ STATUS_DLL_NOT_FOUND. This can impact both 32 and 64 bit Windows as it appears that apktool is using the jvm bitness rather than the actual host OS bitness to determine which aapt version to use.

After running procmon, it appears that the missing assembly is libwinpthread-1.dll

All 14 comments

I have same problem. I have done researching on Google and the solutions described don't help me. I might be do something wrong though. Waiting for someone experienced to troubleshoot the issue 😃

Edit 2: Decompiling with APKTOOL 2.4.0 (Lastest) and recompiling with APKTOOL 2.3.4 worked for me.

Edit 3: I really doubt this method should work.

2.3.4 doesn't work for me, but 2.3.1 OK.

I have also seen a few reports of this since updating to 2.4.0.

There seems to be an issue with the 32-bit Windows aapt binary failing to load dependencies.
-1073741515 is actually the HRESULT 0xC0000135‬ STATUS_DLL_NOT_FOUND. This can impact both 32 and 64 bit Windows as it appears that apktool is using the jvm bitness rather than the actual host OS bitness to determine which aapt version to use.

After running procmon, it appears that the missing assembly is libwinpthread-1.dll

determine which aapt version to use.

@rygo-msft Thank you so much you saved my day !

so how solve this problem? can you explain?

1) Open apktool_2.4.0.jar on WinRAR or any other zip decompressor.
2) Go to prebuilt/windows
3) Delete every existing aapt exe
4) Copy the exes of a previous version of apktool, for example apktool_2.3.4.jar. In this version, they are located at prebuilt/aapt2/windows/aapt2.exe and prebuilt/aapt/windows/aapt.exe
5) ???
6) PROFIT!

I have no idea of the consequences of using this gross, horrible, cthulean hack. Use it at your own risk.

So according to @rygo-msft (thank you very much), the work around consists in using 64-bit version of Java.
Either uninstall the 32-bit version or make sure the 64-bit version is the first entry on the path variable.

The solution is to remove Java for 32-bit systems and install Java for 64-bit systems.

I have only Java for 64 bit systems installed, get the same error though. Any help?

I have only Java for 64 bit systems installed, get the same error though. Any help?

I'm having the same issue

over ?

I've probably tried all the solutions from here and with xda
nothing helps, decompile, compile plain works
but you only need to change one number or letter and an error is already appearing
I used mainly for translation
but now adding values- ?? is impossible
I also checked in the apk editor application and similar errors appear, maybe google or developers added some other protection against editing

I have same problem. I have done researching on Google and the solutions described don't help me. I might be do something wrong though. Waiting for someone experienced to troubleshoot the issue 😃

Edit 2: Decompiling with APKTOOL 2.4.0 (Lastest) and recompiling with APKTOOL 2.3.4 worked for me.

Edit 3: I really doubt this method should work.

thank you, fixed my issue too
i wonder if this could be fixed in new release..

c:\Temp\deep4>apktool b d408
I: Using Apktool 2.4.0
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515): [C:\Users\ittas\AppData\Local\Temp\brut_util_Jar_8965343168224718304.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 228, --version-name, 4.0.8, --no-version-vectors, -F, C:\Users\ittas\AppData\Local\Temp\APKTOOL4253930254059805073.tmp, -0, arsc, -I, C:\Users\ittas\AppData\Local\apktool\framework\1.apk, -S, c:\Temp\deep4\d408\res, -M, c:\Temp\deep4\d408\AndroidManifest.xml]

c:\Temp\deep4>apktool b d408
I: Using Apktool 2.3.4
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

c:\Temp\deep4>


I wonder is it helps, i installed default java package for windows 10 and in system settings i have
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
does it make it 32 bit?

c:\Temp\deep4>java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) Client VM (build 25.231-b11, mixed mode)

Compiling with flag --use-aapt2 worked for me.

32bit is dying and dead. Apktool v2.5.0 makes that clear.

Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafinetiz picture rafinetiz  Â·  3Comments

jpsachse picture jpsachse  Â·  3Comments

mildsunrise picture mildsunrise  Â·  3Comments

harshkuttu picture harshkuttu  Â·  3Comments

xiao-xing-yun picture xiao-xing-yun  Â·  3Comments