[Android Software/Hacking General [Developers Only]] evildog1:
Errors list:

Tip: Press CTRL + F and find the words :)

If there is no error you are looking for, search it on following Github issue pages

Apktool: https://github.com/iBotPeaches/Apktool/issues

Baksmali/smali: https://github.com/JesusFreke/smali/issues

Deompile errors:

* Exception in thread "main" java.lang.NullPointerException (XML related)

This is an issue with apktool 2.4.1. Downgrade to 2.4.0 or below (2.3.4 is better)

* Exception in thread "main" org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: (xx xx xx xx xx xx xx xx)

Rare issue, it usally caused if it tries to decompile encrypted dex from assets folder

Decompile APK with --only-main-classes

* Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: res

This is a trick to prevent decompiling on Windows. Open the APK file using 7zip or Winrar and delete the unnamed file from res folder

View attachment 5218219

Or use Mac/Linux until then

See: https://github.com/iBotPeaches/Apktool/issues/1460

* Invalid debug offset

These are legitimate warnings about inconsistencies in the dex file. The invalid debug offset is otherwise ignored and the classes are successfully disassembled.

Compile errors:

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

This was an issue with Java 8 32-bit on Apktool 2.4.0. Install 64-bit of Java or switch to other version

See: https://github.com/iBotPeaches/Apktool/issues/2141

* Cant find 9patch chunk in file: (...). Renaming it to *.png.

APK is Obfuscated

See: https://xdaforums.com/showpost.php?p=81088145&postcount=619

* Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified

Not a bug. This means the default application that is copied to tmp and executed, could not be done. Therefore it relied on the aapt binary being accessible in the $PATH variable.

* Class (...) has already been interned

Decompile APK with --only-main-classes (apktool 2.4.1 and up only)

* Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml

apktool.yml does not exist, because APK did not decompiled completely. Decompile again

* Float types not allowed

Remove the decimal from version number maybe?

Reported issue: https://xdaforums.com/showpost.php?p=82840671&postcount=699

* Invalid resource directory name

Currently unknown. Try clear framework if you don't work with system apps

* Invalid file name: must contain only (...). Ignoring...

See: https://github.com/iBotPeaches/Apktool/issues/2282

* JAXP 1.5 Support is required to validate XML

Update apktool.jar to the latest version

* No resource identifier found for attribute 'isSplitRequired' in package 'android'

Split APK is not supported yet. See https://github.com/iBotPeaches/Apktool/issues/2218

If you are following some tutorials how to merge split apks into one, then remove the attribute android:isSplitRequired="true" from AndroidManifest.xml, save and compile again

* No resource identifier found for attribute (...) in package (...)

There are many reasons why. Please refer to these issues for more infomation: https://github.com/iBotPeaches/Apktool/issues?q=No+resource+identifier+found+for+attribute+

Try clear framework if you don't work with system apps

Sometimes, removing the attribute will fix the error and the app would run fine without it. Always test if the app is working fine or not

* No resource found that matches the given name

There are many reasons why. This is not always easy to fix

See issues

https://github.com/iBotPeaches/Apktool/issues/2365

https://github.com/iBotPeaches/Apktool/issues/2362

https://github.com/iBotPeaches/Apktool/issues/2339

https://github.com/iBotPeaches/Apktool/issues/2422

Try clear framework if you don't work with system apps

If you are working with system apps, you may need framework installed.

* Tag (...) missing required attribute name.

Not an easy fix, but you can try --use-aapt2 or don't decode resources (-r, --no-res) if you don't need

https://github.com/iBotPeaches/Apktool/issues/1880

Tag <uses-permission> attribute name has invalid character ' '

This was caused by a space in an attribute name. Removing it will fix the compiling error

Example, change:

<uses-permission android:name="com.google.android.finsky.permission.CHECK_LICENSE "/>

to

<uses-permission android:name="com.google.android.finsky.permission.CHECK_LICENSE"/>

* Unsupported res type name for bags

See: https://github.com/iBotPeaches/Apktool/issues/1719

* Unsigned short value out of range: 65536

You have too many methods. The method index can't fit into an unsigned 16-bit value each dex

Simply move your codes to smali_classes(X) or create new one. For example if smali_classes2 is the latest, move code to smali_classes3

Full error log:

Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Lcom/mintegral/msdk/thrid/okhttp/internal/publicsuffix/PublicSuffixDatabase;->findMatchingRule([Ljava/lang/String;)[Ljava/lang/String;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1046)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:345)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:300)
at org.jf.smali.Smali.assemble(Smali.java:131)
at org.jf.smali.AssembleCommand.run(AssembleCommand.java:96)
at org.jf.smali.Main.main(Main.java:100)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x52
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1319)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1042)
... 5 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1279)
... 6 more

* warning: found plain 'id' attribute; did you mean the new 'android:id' name?

See: https://github.com/iBotPeaches/Apktool/issues/2188

* warning: string (...) has no default translation.

Those are warnings, they are fine.

* WARNING: Could not write to (C:\Users\(username)\AppData\Local\apktool\framework), using C:\Users\(username)\AppData\Local\Temp\ instead...

Use the --frame-path [folder] parameter and describing the folder you want the framework resources to reside.

This warning can be ignored if you don't use framework

Others:

* 'java' is not recognized as an internal or external command

Install/Re-install latest version of Java 8 https://java.com/en/download/ or set the enviorment path manually

* APKTOOL_DUMMY

If you get APKTOOL_DUMMY that's generally because apktool can't decode some of the information in the original APK and creates a 'dummy' value instead. Because there's no things called APKTOOL_DUMMY in public.xml, the APK can't be recompiled. It's likely because you try to compile splitted APK with some missing infomation

* Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Increase the java heap size like:

java -Xmx4096m -jar apktool.jar

java -Xmx4g -jar apktool.jar

If your system is Windows and is 64-bit, please uninstall 32-bit version and install 64-bit version (Windows Offline (64-bit)) https://java.com/en/download/manual.jsp

* Unsupported major.minor version (...)

Upgrade java to the latest version https://java.com/en/download/