How to fix apktool compile errors

Well, there are many reasons why but I will show you most common errors. Note, i'm talking about general apk modding, not system apk/framework modding

 

Assets.dex issue "Class xxx has already been interned" and "Not a valid dex magic value"

By default, apktool try to decompile dex from assets folder which would decompile to smali_assets on a root directory of decompiled apk, and compiled to assets.dex upon compiling

This can cause compiling issues

 

Solution:

To fix the problem, decompile APK again with the flag [code]--only-main-classes[/code] to only decompile on main classes in root (classes[0-9].dex) then you can compile without any problem

 

Note: Only for apktool 2.4.1 and up

 

You can try to delete .dex from assets folder or smali_assets/assets.dex but it may cause problems

 

If you are using APK Easy Tool 1.57 and above, you can enable the option "Only disassemble the main dex classes" under Options -> Apktool. Again, only for apktool 2.4.1 and up



Error: No resource identifier found for attribute 'manageSpace' in package 'android'

The attribute does not exist in the framework or it could be fake attribute to prevent compiling

 

Solution:

Remove android:manageSpace="true" from AndroidManifest.xml

 

 

Error: String types not allowed

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

 

Solution:

In this case:

W: Failed to generate resource table for split ''

W: E:\(PathToDecompiledAPK)\res\values\drawables.xml:5: error: Error: String types not allowed (at 'APKTOOL_DUMMY_1c2' with value '').

 

This error tells you which xml an error occured and which line

 

Open the XML file: E:\(PathToDecompiledAPK)\res\values\drawables.xml

Remove drawable name="APKTOOL_DUMMY_1c2" />  at line 5 and save the file

 

You will get another error about public symbol. See below

 

Error: Public symbol XXX declared here is not defined.

Public symbol does not exist in public.xml

 

Solution:

In this case:

W: E:\(PathToDecompiledAPK)\res\values\public.xml:1133: error: Public symbol drawable/APKTOOL_DUMMY_1c2 declared here is not defined.

 

Open the XML file: (PathToDecompiledAPK)\res\values\public.xml

Remove <public type="drawable" name="APKTOOL_DUMMY_1c2" id="0x7f0601c2" /> at line 1133 and save the file

 

Resource error (APKTOOL_DUMMY) (Split APK)

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

 

Solution:

Merge split APKs manually

https://platinmods.com/threads/how-to-turn-a-split-apk-into-a-normal-non-split-apk.76683

 

Or use the SAP (Split APK Packer) tool

https://platinmods.com/threads/sap-split-apks-packer-by-kirlif-windows-linux-merge-split-apks-into-single-apk.101798/

 

Other issues

- APK is protected, encrypted or obfuscated. Reversing of such files is beyond the scope, so find out yourself

- Invalid syntax in smali and xml. You may have done something wrong

 

You can search for useful infomation on the following sites.

Report your issues to them if you feel like to

 

Apktool: iBotPeaches/Apktool

Smali/baksmali: JesusFreke/smali


Comments

Popular Posts

VMOS Pro Global CN FREE Custom ROMs | Gapps, ROOT, Xposed | Android 4.4.4, 5.1.1, 7.1.2, 9.0 ROMs | NO VIP

How to activate VMOS Assistant to run VMOS on Android 12 and above