Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

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

Open ghost opened this issue 7 years ago • 14 comments

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.

ghost avatar Apr 06 '19 10:04 ghost

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.

Vioxini avatar Apr 06 '19 19:04 Vioxini

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

Klug76 avatar Apr 09 '19 13:04 Klug76

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

rygo-msft avatar Apr 12 '19 15:04 rygo-msft

determine which aapt version to use.

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

Ollaha avatar May 16 '19 18:05 Ollaha

so how solve this problem? can you explain?

michael1900 avatar May 29 '19 21:05 michael1900

  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.

jcrabanal avatar May 30 '19 14:05 jcrabanal

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.

ghost avatar Jun 20 '19 23:06 ghost

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

dohn avatar Aug 08 '19 02:08 dohn

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

florianib avatar Sep 04 '19 14:09 florianib

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

I'm having the same issue

slagathor2094 avatar Sep 18 '19 08:09 slagathor2094

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

BlackGlassSkin avatar Oct 08 '19 02:10 BlackGlassSkin

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)

ittasks avatar Oct 23 '19 04:10 ittasks

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

xplorr avatar Oct 26 '19 20:10 xplorr

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

Closing.

iBotPeaches avatar Nov 28 '20 23:11 iBotPeaches