Error When Recompiling system APK

Discussion in 'Question & Answers' started by miuifan1, Feb 22, 2012.

  1. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male
    Hi. I'm trying to edit sustem.apk (miui v4) using APK Manager v4.9. "elso apktool give me an error in recompiling"

    I've managed to decompile it with no errors in the log.txt. But after I make the small change in just one XML file it givs me error ..
    Can anyone tell me what the problem is?

    even if I decompile and then recompile without changing anything, I still get the same error


    Code:
    I: Building apk file...
    Could Not Find C:\Users\Acer\Desktop\dev\dev\place-apk-here-for-modding\../place-apk-here-for-modding/signedSettings.apk
    Could Not Find C:\Users\Acer\Desktop\dev\dev\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSettings.apk
    I: Baksmaling...
    I: Loading resource table...
    I: Loaded.
    I: Loading resource table from file: C:\Users\Acer\apktool\framework\1.apk
    I: Loaded.
    I: Loading resource table from file: C:\Users\Acer\apktool\framework\3.apk
    I: Loaded.
    I: Decoding file-resources...
    W: Cant find 9patch chunk in file: "drawable-hdpi/miui_logo.9.png". Renaming it to *.png.
    W: Cant find 9patch chunk in file: "drawable-en-hdpi/miui_logo.9.png". Renaming it to *.png.
    I: Decoding values*/* XMLs...
    I: Done.
    I: Copying assets and libs...
    I: Checking whether sources has changed...
    I: Smaling...
    I: Checking whether resources has changed...
    I: Building resources...
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/layout-h720dp
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/layout-sw600dp
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/layout-sw600dp-land
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/layout-sw720dp
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/layout-w720dp
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/values-sw600dp
    invalid resource directory name: C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res/values-sw600dp-land
    Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Acer\AppData\Local\Temp\APKTOOL254599558858102368.tmp, -I, C:\Users\Acer\apktool\framework\1.apk, -I, C:\Users\Acer\apktool\framework\3.apk, -S, C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res, -M, C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
        at brut.androlib.Androlib.buildResources(Androlib.java:248)
        at brut.androlib.Androlib.build(Androlib.java:171)
        at brut.androlib.Androlib.build(Androlib.java:154)
        at brut.apktool.Main.cmdBuild(Main.java:182)
        at brut.apktool.Main.main(Main.java:67)
    Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Acer\AppData\Local\Temp\APKTOOL254599558858102368.tmp, -I, C:\Users\Acer\apktool\framework\1.apk, -I, C:\Users\Acer\apktool\framework\3.apk, -S, C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\res, -M, C:\Users\Acer\Desktop\dev\dev\other\..\projects\Settings.apk\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
        ... 6 more
    

    some time give me
    Code:
    The system cannot find the file specified.
    at the end of erro


    plz any help ?
    mark:( ... or any one:(
     
  2. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas

    This error usually means.
    You need the new aapt.exe from the SDK platform-tools folder.
     
  3. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male
    well u have just made it worst
    did't work :(
     
  4. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas
    New error? Anything to post?

    That doesn't help solve the problem.
     
  5. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male
  6. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    Can you post the E / W sections to our logcat.miuiandroid.com site please?
     
  7. 1982Strand

    1982StrandMembers

    Apr 2, 2011
    204
    10
    40
    Make sure you decompile the file again, after you've downloaded the newest aapt, then you can recompile again. (Also given that you have correct PATH in environment variables)
    Otherwise, it's a known issue with apktool 1.4.3, which breaks something in the source when decompiling. But for most people, the newest aapt works.
     
  8. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male
    @1982strand
    Can u plz give me the require tools such as aapt.exe or apktool that well help in decompile or recompile apk without error in zip file
    Or any thing That what u think it will help fixing my issue
    Thanx
     
  9. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    Android SDK latest :)
     
  10. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male
    Mark android sdk will take too much time .. and I have only 3g network
    So that why asked for only the the require tool that well help fixing my issue
    Can u mark extract them for me plz
     
  11. miuifan1

    miuifan1Members

    Feb 22, 2012
    14
    2
    13
    Male

Share Our Site