Apktool back compilation error [How to Solve]

report errors

error: No resource identifier found for attribute 'XXX' in package 'XXX'

Solution:

Save the XML file to “ http://schemas.android.com/apk/res-auto " changed to " http://schemas.android.com/apk/lib/com.app.chasebank "

other

I directly used Android killer for back compilation. There were more than 10 errors at once. It was too troublesome to change one by one, so I simply wrote a python script:

import os
import re

file = "error.txt"

def change_content(file):
    if os.path.exists(file):
        with open(file) as f:
            content = f.read()
        if "http://schemas.android.com/apk/res-auto" in content:
            print(file+":已修复")
            content = content.replace("http://schemas.android.com/apk/res-auto","http://schemas.android.com/apk/lib/com.app.chasebank")
            with open(file,"w") as f:
                f.write(content)

with open(file,encoding='utf8') as f:
    data = f.read()

result = re.findall(">W: (.*?):\d+: error: No resource identifier found for attribute",data)
for file in result:
    change_content(file)

Copy the error to the error.txt file, and then run the script to modify the XML file directly.

Sometimes, such errors will appear in the back compilation. You may need to copy the errors again and then execute the script. That is to say, some errors are not reported because the previous errors have not been solved, and all such errors cannot be reported at one time.

Read More: