MiCode / patchrom

Use disassemble/assemble technology to porting miui to misc android devices
http://micode.net/forum-55-1.html
493 stars 370 forks source link

Framework.res not building #18

Open Paul987 opened 12 years ago

Paul987 commented 12 years ago

Hi,

I keep getting these errors when building framework.res:

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)

It happens on both v4 and Gingerbread.

So, what gives??

Thanks in advance!

Gingerbread:

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /var/folders/37/h0kwn8mj6kldypqmbxg1cpmm0000gn/T/APKTOOL3427029977752328793.tmp, -x, -I, /Users/Paul/apktool/framework/1.apk, -S, /Users/Paul/gingerbread/marvel/.build/framework-res/res, -M, /Users/Paul/gingerbread/marvel/.build/framework-res/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, /var/folders/37/h0kwn8mj6kldypqmbxg1cpmm0000gn/T/APKTOOL3427029977752328793.tmp, -x, -I, /Users/Paul/apktool/framework/1.apk, -S, /Users/Paul/gingerbread/marvel/.build/framework-res/res, -M, /Users/Paul/gingerbread/marvel/.build/framework-res/AndroidManifest.xml] at brut.util.OS.exec(OS.java:83) at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191) ... 6 more

v4:

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /var/folders/37/h0kwn8mj6kldypqmbxg1cpmm0000gn/T/APKTOOL4568253920662917919.tmp, -x, -I, /Users/Paul/apktool/framework/1.apk, -S, /Users/Paul/patchrom/marvel/out/framework-res/res, -M, /Users/Paul/patchrom/marvel/out/framework-res/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, /var/folders/37/h0kwn8mj6kldypqmbxg1cpmm0000gn/T/APKTOOL4568253920662917919.tmp, -x, -I, /Users/Paul/apktool/framework/1.apk, -S, /Users/Paul/patchrom/marvel/out/framework-res/res, -M, /Users/Paul/patchrom/marvel/out/framework-res/AndroidManifest.xml] at brut.util.OS.exec(OS.java:83) at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191) ... 6 more

yu88my commented 12 years ago

this problem may be caused by your aapt. you can invoke the command "which aapt" , and verify if or not there is the aapt in your pc.

Paul987 commented 12 years ago

Nope. aapt is there. BTW, for future reference, I'm building with a Mac. Also, I've made sure my PATH is correct.

yu88my commented 12 years ago

Sorry I didn't meet this problem, can you try with linux os or with lastest version of aapt?

Paul987 commented 12 years ago

Hmm. Neither work. Used Ubuntu and the newest aapt. Tried Gingerbread only. I'm guessing I didn't edit the makefile properly? Here it is:

#

Makefile for marvel

#

The original zip file, MUST be specified by each product

local-zip-file := CM7.zip

The output zip file of MIUI rom, the default is porting_miui.zip if not specified

local-out-zip-file := MarvellousMiuiGB.zip

All apps from original ZIP, but has smali files chanded

local-modified-apps := CSC LogsProvider SettingsProvider MediaProvider

All apks from MIUI execept MIUISystemUI and framework-miui-res.apk

local-miui-apps := Contacts ContactsProvider Mms TelephonyProvider ThemeManager Launcher2 \ DownloadProvider TelocationProvider Notes Music Torch DownloadProviderUi Updater

All apps need to be removed from original ZIP file

local-remove-apps := AlipayGphone AmsComposer AndroidQQ_Samsung_Seine BuddiesNow cooldict glyder2 \ ImgoTV iReader kaixin001 Memo MiniDiary MinimalHome mreader PressReader ReadersHub Renren \ Sinamicroblog SinaNews SinaStock SinaWeather SocialHub Tencentmicroblog \ TomEbook Tonghuashun TouchWiz30Launcher Youku_Samsung_seine MusicPlayer \ MediaHub PhotoRetouching VideoEditor thinkdroid QYVideoClient \ Days DigitalClock Dlna DualClock Email EmailWidget FTC FTM FTS Kobo \ Microbesgl Navigator PostIt Protips QuickSearchBox SamsungApps SamsungAppsUNA3 \ SamsungIM SamsungWidget_ProgramMonitor SecretWallpaper1 SecretWallpaper2 \ SevenEngine SnsAccountKx SnsAccountRr SnsDisclaimer SnsImageCache SnsProvider \ Tasks TasksProvider Term TrimApp TwCalendarAppWidget Zinio \ samsungappswidget syncmldm viva_tts

To include the local targets before and after zip the final ZIP file,

and the local-targets should:

(1) be defined after including porting.mk if using any global variable(see porting.mk)

(2) the name should be leaded with local- to prevent any conflict with global targets

local-pre-zip := local-zip-misc local-after-zip:= local-test

The local targets after the zip file is generated, could include 'zip2sd' to

deliver the zip file to phone, or to customize other actions

include $(PORT_BUILD)/porting.mk

To define any local-target

local-zip-misc: cp misc/com.google.android.maps.jar $(ZIP_DIR)/system/framework/ @echo Add google apks cp misc/apk/* $(ZIP_DIR)/system/app/ @echo Replace build.prop cp misc/build.prop $(ZIP_DIR)/system/build.prop

local-test: echo "an example action"

Note I removed Phone.apk from the "All apps from original ZIP, but has smali files changed", I'll have to fix that later.

Paul987 commented 12 years ago

So?

jcorrea86 commented 12 years ago

I remember I had this problem on my build and it was caused by missing one of the framework apks. Do you have all of them, 1 2 3? I was building for ICS and noticed I was missing 2.apk. Once I got that, everything started working... somewhat :P but at least I got passed that error.

yu88my commented 12 years ago

make apktool-if you will get the apks in ~/apktool/framework/

Paul987 commented 12 years ago

Thanks! Sorry for not answering. yu88my's method doesn't seem to work, and jcorrea86, I'm not really sure if you mean the apktool frameworks or the Miui framework-res.apk. Although I'm guessing it's the former. If so, I only have 1, 3 and 6. If I need different framework files, where do I find them?? For some reason, I've forgotten how I ended up with them. Sorry for the trouble this is causing!

jcorrea86 commented 12 years ago

Hey Paul987.... Yes, it would be the apktool frameworks. Check out this link below for Open Issue 2 which is having a similar issue maybe it will help. I tried it and it works, but I'm currently looking for a 2.apk for motorola, not sure what brand your phone is.

https://github.com/MiCode/patchrom/issues/2

zhoujiamurong commented 11 years ago

How to fix the problem?

I find the same problem. I download MICode && Honer Code

I think aapt is work. which aapt /home/****/MI/patchrom/tools/aapt

but aapt, is not work. aapt,: command not found