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
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: [BUG]Issues repacking res it gives issues with apktool_dummy in integers.xml and dimens.xml · Issue #2462 · iBotPeaches/Apktool
Solution:
In this case:
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:
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
Or use the SAP (Split APK Packer) tool
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
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
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: [BUG]Issues repacking res it gives issues with apktool_dummy in integers.xml and dimens.xml · Issue #2462 · iBotPeaches/Apktool
Solution:
In this case:
Code:
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:
Code:
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
How to turn a split APK into a normal non-split APK
Hey guys, recently many modders contacting me about how to mod a split APK. We have already many tutorials about how to download or extract the split APKs, mod a split APK as it is and how to use a split APK installer to make the mod apply to the device. Here some examples of the mentioned...
platinmods.com
Or use the SAP (Split APK Packer) tool
SAP (Split APKs Packer) v6.9.9 (Windows & Linux) - Merge split APKs into single APK
Note, this tool is not mine. I just shared it from other site SAP (Split APKs Packer) Requirements: JRE/OpenJDK 1.8 or above Overview: A simple and fast tool to transform Android App Bundles into single Android Packages. DOWNLOAD: Mega.nz: 164.95 MB folder on MEGA Box: Box Sbupload: View...
platinmods.com
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
Last edited: