[Android Themes] Aniruddha_Pathak:
Yo Guys! After a long time I am writing a thread on Apktool after writing THIS thread!

So, this time I shall be dealing with finding the errors while recompiling a SYSTEM App in apktool!

Most of us know how to decompile/recompile apks, but if we get the error, we often get scared and feel lost.

So this guide shall surely be helping you with knowing what error have you exactly faced, and may be you can work on it :)

THIS GUIDE IS HUGE SO YOU NEED PATIENCE TO READ IT!​

So, let's start.

So, for example, I tried the 5TabUI guide by Sir [MENTION=5837474]dendenXD[/MENTION] in my JB 4.2.2 device. When I recompiled I got this error:

C:\Documents and Settings\TEMP>apktool b SystemUIGionee
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
C:\Documents and Settings\TEMP\SystemUIGionee\res\layout\gemini_status_bar_expanded.xml:10: error: Error: No resource found that matches the given name (at 'id' with value '@id/dendenxd').
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17,
-F, C:\DOCUME~1\TEMP\LOCALS~1\Temp\APKTOOL7638241710007663088.tmp,
-0, arsc, -I, C:\Documents and Settings\TEMP\apktool\framework\1.apk,
-S, C:\Documents and Settings\TEMP\SystemUIGionee\res,
-M, C:\Documents and Settings\TEMP\SystemUIGionee\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17,
-F, C:\DOCUME~1\TEMP\LOCALS~1\Temp\APKTOOL7638241710007663088.tmp, -0, arsc,
-I, C:\Documents and Settings\TEMP\apktool\framework\1.apk,
-S, C:\Documents and Settings\TEMP\SystemUIGionee\res,
-M, C:\Documents and Settings\TEMP\SystemUIGionee\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17,
-F, C:\DOCUME~1\TEMP\LOCALS~1\Temp\APKTOOL7638241710007663088.tmp, -0, arsc,
-I, C:\Documents and Settings\TEMP\apktool\framework\1.apk,
-S, C:\Documents and Settings\TEMP\SystemUIGionee\res,
-M, C:\Documents and Settings\TEMP\SystemUIGionee\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more

C:\Documents and Settings\TEMP>

Big isn't it? Well not hard though.

Let's see what apktool has got for you.

Scroll through the error.

And find this line in my error.

C:\Documents and Settings\TEMP\SystemUIGionee\res\layout\gemini_status_bar_expanded.xml:10: error: Error: No resource found that matches the given name (at 'id' with value '@id/dendenxd').

Notice some thing?

The line above is the only error that I got, so we now have a easy work!

When checking error,

First separate it.

Okay let me separate every thing.

This is the xml, where you have a error.

C:\Documents and Settings\TEMP\SystemUIGionee\res\layout\gemini_status_bar_expanded.xml

In the same line you will see a number, here it is:

:10:

This it the number of line in the xml where error is seen.

Next, the error!

This is the error that I am facing:

error: Error: No resource found that matches the given name (at 'id' with value '@id/dendenxd')

Yes, that is the error!

So here is the solution to solve the 'id' errors.

In my case, I will open gemini_status_bar_expanded, directly jump to line 10, and look for @id/dendenxd in the line, alright?

Now just make:

@id/dendenxd

Look like this:

@+id/dendenxd

Save the XML. Done. Now recompile the UI and voila! You are done! :D

Now next, we shall be dealing with a big error than the previous one.

Recently, one of my friend gave me a UI that even when recompiled directly without any changes, would give a big list of errors!

So I tried it and removed the errors!

This is what the error was:

C:\Documents and Settings\TEMP>apktool b AryanUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 17, --target-sdk-version, 17, -F, C:\DOCUME~1\TEMP\LOCALS~1\Temp\AP
KTOOL1329044921247052698.tmp, -I, C:\Documents and Settings\TEMP\apktool\framewo
rk\1.apk, -S, C:\Documents and Settings\TEMP\AryanUI\res, -M, C:\Documents and S
ettings\TEMP\AryanUI\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17, -F, C:
\DOCUME~1\TEMP\LOCALS~1\Temp\APKTOOL1329044921247052698.tmp, -I, C:\Documents an
d Settings\TEMP\apktool\framework\1.apk, -S, C:\Documents and Settings\TEMP\Arya
nUI\res, -M, C:\Documents and Settings\TEMP\AryanUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 17, --target-sdk-version, 17, -F, C:\DOCUME~1\TEMP\LOCALS~1\Temp\APKT
OOL1329044921247052698.tmp, -I, C:\Documents and Settings\TEMP\apktool\framework
\1.apk, -S, C:\Documents and Settings\TEMP\AryanUI\res, -M, C:\Documents and Set
tings\TEMP\AryanUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title.xml:14: error: Error: No resource found that matches the given name (at 's
tyle' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title.xml:19: error: Error: No resource found that matches the given name (at 's
tyle' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title.xml:21: error: Error: No resource found that matches the given name (at 's
tyle' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title_gemini.xml:14: error: Error: No resource found that matches the given name
(at 'style' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title_gemini.xml:19: error: Error: No resource found that matches the given name
(at 'style' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title_gemini.xml:24: error: Error: No resource found that matches the given name
(at 'style' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title_gemini.xml:26: error: Error: No resource found that matches the given name
(at 'style' with value '@style/SystemBarNotificationText').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:5
: error: Error: No resource found that matches the given name (at 'style' with v
alue '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:6
: error: Error: No resource found that matches the given name (at 'style' with v
alue '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:7
: error: Error: No resource found that matches the given name (at 'style' with v
alue '@style/SystemBarPanelSettingsContents').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
0: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
1: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
2: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
3: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsContents').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
5: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
6: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
7: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:1
8: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsContents').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
1: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
2: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
3: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
6: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
7: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
8: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:2
9: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsContents').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:3
2: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:3
3: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsRow').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:3
4: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsIcon').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:3
5: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsContents').
C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_settings_view.xml:3
7: error: Error: No resource found that matches the given name (at 'style' with
value '@style/SystemBarPanelSettingsPanelSeparator').

C:\Documents and Settings\TEMP>

Veeeery biiiiiig!!!!

Yes, now this is time consuming!

Now. what we have to do is, look for the errors.

Yes, right above I told you how to look for a error, just like that let's solve one error here.

So one of the error is:

C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_
title.xml:14: error: Error: No resource found that matches the given name (at 's
tyle' with value '@style/SystemBarNotificationText').

So, according to this, the error is in:

C:\Documents and Settings\TEMP\AryanUI\res\layout\system_bar_notification_panel_title.xml

In line:

:14:

And the error is:

Error: No resource found that matches the given name (at 'style' with value'@style/SystemBarNotificationText').

So, how to solve this if there is no style with such name in your UI?

SIMPLE, JUST DELETE THOSE LINES FROM THE XMLs!​

Yes!

Let's do it.

I shall now open system_bar_notification_panel_title.xml, look at line 14 in it, and search for a line like:

style="@style/SystemBarNotificationText"

And simply delete that WHOLE line and save the xml.

Same goes with all other errors! If you find a error that has been titled this value not found from an xml, simply delete the line, with correct SPACING by the way! :D

Easy right!

Now coming to smali errors while recompiling.

Most of the smalis are usually built for apktool 1.5.2 , so I always recommend using apktool 1.5.2 for daily use.

If it is specified that the mod needs apktool 2.0.0, then you are free to use apktool 2.0.0!

That's it for today! Hope this helped you!

Credits:

[MENTION=3924617]iBotPeaches[/MENTION][For APKTOOL!]

[MENTION=6015092]out386[/MENTION] [Ritayan Chakraborty: For helping me out in troubleshooting errors and solve the 'id' errors]

[MENTION=6329677]arun.negi004[/MENTION][For the tip of deleting the required lines] [MENTION=6228131]Aniruddha_Pathak[/MENTION][ME]

And YOU!

HIT THANKS IF YOU LIKED MY WORKS!​