2
votes

i'm trying to rebuild an apk using apktool but receiving the Error related to retrieving parent in styles.xml. I found many posts in internet related to this suggesting to use old version apktool or aapt.exe. But i found this>>

http://code.google.com/p/android-apktool/wiki/CommonErrors#Error_retrieving_parent_for_item:_No_resource_found_that_matches

Can you please show me how to use it?

These are the lines which contains errors

styles.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:149: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:192: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:208: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base.DropDownItem'.

styles.xml:234: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:241: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.Base'.

styles.xml:260: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Base'.

styles.xml:293: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

styles.xml:485: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Base'.

and the style.xml file(it's in the res>values folder) which contains these 10 errors is here>> http://www.datafilehost.com/d/b22b2575


styles.xml:52: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'.

and this ^^ error is here(folder res>values-v14)

    <style name="Widget.AppCompat.Base.ActivityChooserView">
    <item name="android:gravity">center</item>
    <item name="android:background">@drawable/abc_ab_share_pack_holo_dark</item>
    <item name="android:divider">?dividerVertical</item>
    <item name="android:showDividers">middle</item>
    <item name="android:dividerPadding">6.0dip</item>
</style>

please don't mind the spaces in the above code..i'm having problems with posting codes here.

2
This question appears to be off-topic because it is about violating intellectual property.Phantômaxx
Not off topic at all -- it is helpful if someone is decompiling their own appTanner Perrien

2 Answers

2
votes

As the first link you mentioned above , you just need add a line . http://code.google.com/p/android-apktool/wiki/CommonErrors#Error_retrieving_parent_for_item:_No_resource_found_that_matches

<style name="Widget.AppCompat.Base"></style>   //add this line 
<style name="Widget.AppCompat.Base.ActivityChooserView">
  <item name="android:gravity">center</item>
  <item name="android:background">@drawable/abc_ab_share_pack_holo_dark</item>
  <item name="android:divider">?dividerVertical</item>
  <item name="android:showDividers">middle</item>
  <item name="android:dividerPadding">6.0dip</item>
</style>

every time you meet this problem, you just need add the parent item before the error line

0
votes

Similar errors can also appear when a framework apk is not available. In my case, apktool d reported no errors, but I've still needed to pull framework-res.apk from the device and provide it to apktool:

apktool if framework-res.apk

Rebuilding the app worked fine afterwards.

See the apktool documentation for details.