yashsingh1/xdaforums huggingface dataset:
[Android Software Development] mateorod:
I haven't read the whole thread, but since I see the issue on the front page and the last...

I have encountered and fixed this in several ways...

I didn't see a step to extract and save the files from the framework-res.apk. Apktool will extract some ROM specific files in order to recompile apps like the SystemUI.apk

The code is

apktool if framework-res.apk

This will extract and install some files apktool need to a new apktool directory in your home folder.

Even after doing this, I still had the problem on a different roms SystemUI.apk. It turns out there are several different versions of apktool, that are used to recompile different ICS apps. I don't have the version numbers with me, but make sure your SDK is up to date, and pull the aapt that is in the platform-tools bin.

If you are already using that version, then go to the google.code site for apktool and download the previous version and replace the aapt and apktool with that.

I know this isn't very specific, and I apologize. I kind of stumbled upon this thread and don't have my resources with me.

But I ABSOLUTELY GUARANTEE that your issue is either the fact that you didn't extract the framework-res.apk files or that you are using the wrong version of apktool. Really, apktool needs an update that solves this known issue, but it doesn't appear to be on the horizon. Even if you think you have done this and I am wrong, I'm not. Get the last two versions of apktool, update your sdk, and replace both apktool and aapt in you usr/local/bin or where ever you have it, one set at a time, repeating the recompile command with each version. All of a sudden it will magically work.

Trust me, this is the problem.

Edit: (to be honest, I am almost positive the problem is the apktool version. But since I didn't see the apktool if framework-res.apk command in your post, I added that tip to be sure. I've been there, and this fixed it for me.)
[Android Software Development] 1982Strand:
Make sure you install framework-res, framework-miui-res and also a sense framework (i.e. com.htc.resources.apk - will install as 2.apk)

If you still get the error, try looking in the /root/apktool/ folder, make sure the same apks are installed here too :)
[Android Software Development] 1982Strand:
Ok, try this patch i attached.

Note that the first hunk in the reject file is not a "bad" reject, that exact hunk is "patched" from the beginning and looks like it should already. So my patch will apply for the last 2 hunks..

It wil probably be successfull, but might be offset a bit :)
[Android Software Development] kmelkon:
sorry if this was posted but can i use cm9 as a base ??
[Android Software Development] pyroemaniac:
how did you guys get the MiCode Repo to sync? It keeps telling me that it does not appear to be a git repository.
[Android Software Development] NineInchNails:
repo init -u git://github.com/MiCode/patchrom.git -b ics

repo sync

Should download then. If not create a new dir

mkdir whateveryouwant

cd whateveryou want

repo init cmd I posted.

repo sync
[Android Software Development] pyroemaniac:
Thank you for the reply, but the same thing occurs when I do all of that. This is what the terminal shows.

fatal: '../MiCode/patchrom_android.git' does not appear to be a git repository

fatal: The remote end hung up unexpectedly

error: Cannot fetch MiCode/patchrom_android
[Android Software Development] NineInchNails:
Because its not patchrom_android.git

It's patchrom.git

repo init -u git://github.com/MiCode/patchrom.git -b ics
[Android Software Development] pyroemaniac:
Yes I know that, I type it in exactly as it says and that is the error I get.
[Android Software Development] NineInchNails:
Dunno what to tell you then. That cmd syncs the repo just fine for me so something on your end isn't right.
[Android Software Development] ZduneX25:
@pyroemaniac do not type, copy and paste (one by one):

Still have problems then start from the begining: http://source.android.com/source/initializing.html
[Android Software Development] pyroemaniac:
I am copying and pasting haha, I think I could be something I don't have installed or the fact I'm on Ubuntu 12.04
[Android Software Development] ingbrzy:
Hello...

I want just ask, in which folder I have to resolve rejects...

for example, I have reject for

/home/ingbrzy/patchrom/i9100/temp/reject/android.policy.jar.out/smali/com/android/internal/policy/impl/

PhoneWindowManager$18$1.smali.rej

but I dont have that smali file in

/home/ingbrzy/patchrom/i9100/android.policy.jar.out/smali/com/android/internal/policy/impl/

So, where to find corrent folder to modify smali from rejects..?
[Android Software Development] 1982Strand:
You need to edit files in your device root folder (ex: framework.jar.out)

And about that PhoneWindowManager$18 and -$18$1, take a look at your $20 and $20$1 :) Pretty sure you'll find what you need..

(And it wouldn't hurt to search the thread, this issue has already been discussed..)
[Android Software Development] lontu:
Is it possible to download MIUI Gingerbread PatchROM with the below commands:

repo init -u git://github.com/MiCode/patchrom.git -b gingerbread; repo sync

Where from to download Gingerbread MIUI PatchROM ? Please provide the link...

Thanks in advance
[Android Software Development] lontu:
Hi...

I am trying to build MIUI on Gingerbread+ following the process mentioned in the first post but struck with the following error where 'make'.

Any solution for this will be appreciated...
[Android Software Development] 1982Strand:
Those are apktool errors, not patchrom. You have errors in strings. Multiple substitution means you have wrong formatting in a string, where you need to add formatted="false". The other one with the tag error, you'll have to go through your strings and compare it with the original, something messed up in a tag somewhere.

Sendt fra min HTC Desire med Tapatalk2
[Android Software Development] Duarte777:
This works with CM9 (ics) ?
[Android Software Development] 1982Strand:
Show me the lines 200-210 of strings.xml :-)

Sendt fra min HTC Desire med Tapatalk2
[Android Software Development] 1982Strand:
Well, yes and no.

Patchrom builds on stock Android. But you CAN get it to work with CM9, it just means A LOT of manual patching. :-)

Sendt fra min HTC Desire med Tapatalk2
[Android Software Development] 1982Strand:
Oops, sorry, double post..
[Android Software Development] lontu:
Which Strings.xml you are refering here?
[Android Software Development] 1982Strand:
Oh, my bad! So you Got the phone.apk errors fixed?

In systemui, seems apktool is messing up with the .9 pngs, what version of apktool are you using?

If you dont change anything In systemui, do you still get the error?
[Android Software Development] ZduneX25:
@1982strand any ideas how to compule miui using patchrom since they added 720p support: http://pastebin.com/rtt6jQdV??
[Android Software Development] stenka85:
update patchrom_tools repository.
[Android Software Development] ZduneX25:
@stenka85 I was updated, anyway problem has been fixed
[Android Software Development] ChaosChris:
I tried the guide with the ypg1 (galaxy s wifi 4) and its working :D there where some erros in some xml´s but i fixed thatr, my problem is that the miui rom is not complete. The most apps are stock apps ( lockscreen settings calendar etc ... ) :/ can someone help me? i posted the rom here in the thread are the link for donwload and for my source code.

Thanks!

sry for my bad english
[Android Software Development] Messi10:
can i use thiss with galaxy mini

ldpi + armv6
[Android Software Development] UtCollector@gmail.com:
Compile MIUI for new device

I have some problems compiling a MIUI rom.

I mainly followed the guide on the github here: https://github.com/MiCode/patchrom.

I want to Compile for a new device.. A Tom-Tec 7 excellent OS ICS. Its a Telechip Tablet. China build.. Its does have root. Itś still a Dutch/EU stock rom.

specs here info here. Duthc..:http://www.androidworld.nl/forum/to...ellent-7-inch-android-4-0-tablet-atf3657.html

Here at this command the problems start:

adb reboot recovery (from recovery i get nearly no results. )

Sow i run this command when the tabet is running:

../tools/releasetools/ota_target_from_phone -r

During copy procces i copy the right recovery.img, boot.img and recovery.fstab to the right folder. (they dont get copied on running tablet its seems?) This seems to fix some problems.

and i get the Error:

KeyError: '/system'

failed: Device or resource busy

Probably cose i have the system running i gues..

I just copped the rest of the system folder in the right place.

I than go to the next step..: cp ../honor/makefile .

its just go´s to next line.. Not sure what should happen. cp is a copy command if im right.

I go on with next command: make workspace

I see i miss some apk´s. they ore not in my stock rom. And framework-res.apk does not get coppied. See pastebin: http://pastebin.com/qfu5S4qG

But i do get Prepare workspace completed!

Next command is: make firstpatch

This seems to do nothing some time but finally go´s on with some errors

http://pastebin.com/qfu5S4qG

last command is: make fullota

Its starts but stops a android.policy.jar

I hope someone can make some sugestion how to fix it.
[Android Software Development] cowsquad:
You must root your phone in order to get everything working
[Android Software Development] UtCollector@gmail.com:
Thx, Now i know how to fix first part. I do have root for the apps but i have no kernel root. I hope i can find out have to get it.:D
[Android Software Development] ZduneX25:
How is it possible that miui gb has only 15 apps in source: https://github.com/MiCode/patchrom_miui/tree/gingerbread/system/app ?

Where are Setting.apk and all missing ones?
[Android Software Development] irberserk:
Sorry i have read all the thread but im confused :( i don't understand what smali i must fix after "make firstpatch" i have the tmp folder with reject, older etc etc smali and in the root of my phone folder i have the framework. I understand that i must modified the smali in the phone root folder and not the smali in tmp folder. it's right? But the problem is one, a lot of smali in reject folder are too different respect the smali in root phone folder and i have difficulty to fix it! Someone can explain me how?I do an example:

This is the rejected smali (ActivityThread.smali.rej)

*** ActivityThread.smali	2012-10-19 12:45:38.183277586 +0200
--- ActivityThread.smali	2012-10-19 12:42:48.211277585 +0200
***************
*** 8741,8746 ****
or-int/lit16 v0, v0, 0xd00

:cond_3
iget-object v7, p1, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

if-eqz v7, :cond_4
--- 8741,8748 ----
or-int/lit16 v0, v0, 0xd00

:cond_3
+ invoke-static {v0}, Landroid/app/MiuiThemeHelper;->handleExtraConfigurationChanges(I)V
+
iget-object v7, p1, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;

if-eqz v7, :cond_4
***************
*** 10130,10145 ****
move-result-object v3

.local v3, metrics:Landroid/util/DisplayMetrics;
- new-instance v4, Landroid/content/res/Resources;

- .end local v4 #r:Landroid/content/res/Resources;
invoke-virtual {p0}, Landroid/app/ActivityThread;->getConfiguration()Landroid/content/res/Configuration;

move-result-object v6

! invoke-direct {v4, v0, v3, v6, p2}, Landroid/content/res/Resources;-><init>(Landroid/content/res/AssetManager;Landroid/util/DisplayMetrics;Landroid/content/res/Configuration;Landroid/content/res/CompatibilityInfo;)V

- .restart local v4 #r:Landroid/content/res/Resources;
iget-object v7, p0, Landroid/app/ActivityThread;->mPackages:Ljava/util/HashMap;

monitor-enter v7
--- 10132,10146 ----
move-result-object v3

.local v3, metrics:Landroid/util/DisplayMetrics;

invoke-virtual {p0}, Landroid/app/ActivityThread;->getConfiguration()Landroid/content/res/Configuration;

move-result-object v6

! invoke-static {v0, v3, v6, p2}, Landroid/content/res/MiuiClassFactory;->newResources(Landroid/content/res/AssetManager;Landroid/util/DisplayMetrics;Landroid/content/res/Configuration;Landroid/content/res/CompatibilityInfo;)Landroid/content/res/Resources;
!
! move-result-object v4

iget-object v7, p0, Landroid/app/ActivityThread;->mPackages:Ljava/util/HashMap;

monitor-enter v7

And this is the ActivityThread.smali in root phone folder:

ActivityThread.smali

How i must modified it?:confused:
[Android Software Development] dbrannon79:
I have a question about the process in step one! opening the link to gethub the instructions to get the patchrom downloaded as follows..

after the last command it has been "syncing" all night and all day!! is this normal? I have been checking the patchrom folder periodically and there is nothing there!

also there are only three files to download in the link other than following the readme further down on the page!

Did I miss something or has the link been changed?

edit: I am following this guide for porting Miui to the Samsung captivate glide!
[Android Software Development] dbrannon79:
never mind! it finally finished.... 20gb or so later! the patchrom folder is full! now on to building!!! :p
[Android Software Development] cowsquad:
20gb damn that is 3 times the size of Aosp. Shees
[Android Software Development] cmbaughman:
Ok here's all you need to fix this last error just run something like rm -rf out/MiuiHome/res/*geui*

See you don't need that to build or even run normally. Its leftover from the mi china stuff which you shouldn't need to worry with. Do this for all of those errors for every app that this happens on. Just remove the problem folders.

Pacman for the 3vo CDMA

---------- Post added at 07:49 PM ---------- Previous post was at 07:46 PM ----------

One more: you guys that are DL ing the entire repo, stop. If you are only building one device simply run repo init .........

Then open the file .repo/manifest.xml and take out ONLY the devices you don't want to build. Keep your target device or device you want to port from and the android, build, miui, and tools projects. THEN run repo sync. It will reduce that size to a much more manageable size!

Pacman for the 3vo CDMA
[Android Software Development] singh_dd93:
I still get the error by deleting those folders.

ANd yeah i only downloaded for lt18i and lt26i and not others

After executing your command

make fullota
>>> build out/MiuiHome.apk...
/home/dds/miui/tools/apktool --quiet b out/MiuiHome out/MiuiHome.apk
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:595: error: Public entry identifier 0x7f0a002b entry index is larger than available symbols (index 43, total symbols 43).
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:595: error: Public symbol dimen/dragViewOffsetX declared here is not defined.
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:596: error: Public entry identifier 0x7f0a002c entry index is larger than available symbols (index 44, total symbols 43).
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:596: error: Public symbol dimen/dragViewOffsetY declared here is not defined.
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:600: error: Public symbol dimen/workspace_widget_cell_height declared here is not defined.
/home/dds/miui/lt18i/out/MiuiHome/res/values/public.xml:599: error: Public symbol dimen/workspace_widget_cell_width declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL6349768756691439805.tmp, -I, /home/dds/apktool/framework/1.apk, -I, /home/dds/apktool/framework/6.apk, -S, /home/dds/miui/lt18i/out/MiuiHome/res, -M, /home/dds/miui/lt18i/out/MiuiHome/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, /tmp/APKTOOL6349768756691439805.tmp, -I, /home/dds/apktool/framework/1.apk, -I, /home/dds/apktool/framework/6.apk, -S, /home/dds/miui/lt18i/out/MiuiHome/res, -M, /home/dds/miui/lt18i/out/MiuiHome/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
make: *** [out/MiuiHome.apk] Error 1

the errors of geui have been resolved but this main error is still there.

I am usin the latest aapt and apktool in usr/bin folder

while the miui tool's folder has its own aapt and apktool.

Should i remove my apktool from usr/bin ?
[Android Software Development] dimon2242:
android.policy.jar.out

framework.jar.out

framework-res

services.jar.out

Its need decompile from CM9, or MIUI?
[Android Software Development] cmbaughman:
Ah yes you definitely want the "special" apktool AND aapt from MIUI. They were created special by the team for MIUI. If you have apktool already in usr/bin or where ever just make sure the MIUI ones appear first in your $PATH. One way is to just remove the others from path but you can add miui's easily by putting something like:

export PATH=/what/ever/path/to/miui/micode/tools:$PATH

in your home directory's .bash_profile or .bashrc. Then the next time you log in to Linux it will take effect. Or to apply immediately you can do source .bash_profile or what have you.

As far as the question about those framework jar files, you need both your cm and miui jar files but if you do have the cm ROM in your projects directory following the github.com/micode/patchrom tutorial, the patchrom tools will help you to merge the relevant bits into the miui jars. If you search for my buddy lens_flare's guide to porting miui it will help with the details at least to understand what patchrom is doing for you behind the scenes. Even when you get your patchrom building OK you really got to understand the things in that guide to fix whatever is required by your device that patchrom may have missed.

I love patchrom and think its a really great thing but you will have a long road of building and then booting/building/logcat to make everything build.

Pacman for the 3vo CDMA
[Android Software Development] cowsquad:
is this guide working on galaxy nexus toro. Has anyone tried it ?
[Android Software Development] ZduneX25:
Remove following files:

notification_bg.xml

notification_bg_low.xml

from framework-res/res/drawable

__________

Sent from awesome Galaxy S3
[Android Software Development] fedevd:
fede@fede-ubuntu:~/patchrom/adv$ make fullota
/home/fede/patchrom/tools/apktool --quiet d -f /home/fede/patchrom/miui/HDPI/system/framework/framework.jar out/framework_miui
>>> build out/framework.jar...
/home/fede/patchrom/tools/add_miui_smail.sh >/dev/null out/framework_miui out/framework
/home/fede/patchrom/tools/apktool --quiet b out/framework out/framework.jar
Exception in thread "main" org.jf.dexlib.Util.ExceptionWithContext: method index is too large.
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
at org.jf.dexlib.Item.addExceptionContext(Item.java:176)
at org.jf.dexlib.Item.writeTo(Item.java:119)
at org.jf.dexlib.Section.writeTo(Section.java:119)
at org.jf.dexlib.DexFile.writeTo(DexFile.java:716)
at brut.androlib.src.DexFileBuilder.getAsByteArray(DexFileBuilder.java:75)
at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:58)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:222)
at brut.androlib.Androlib.buildSources(Androlib.java:179)
at brut.androlib.Androlib.build(Androlib.java:170)
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: java.lang.RuntimeException: method index is too large.
at org.jf.dexlib.Code.Format.Instruction35c.writeInstruction(Instruction35c.java:102)
at org.jf.dexlib.Code.Instruction.write(Instruction.java:57)
at org.jf.dexlib.CodeItem.writeItem(CodeItem.java:258)
at org.jf.dexlib.Item.writeTo(Item.java:116)
... 12 more
code_item @0x1a9098 (Lcom/google/android/gles_jni/EGLImpl;->eglCreateWindowSurface(Ljavax/microedition/khronos/egl/EGLDisplay;Ljavax/microedition/khronos/egl/EGLConfig;Ljava/lang/Object;[I)Ljavax/microedition/khronos/egl/EGLSurface;)

make: *** [out/framework.jar] Error 1
fede@fede-ubuntu:~/patchrom/adv$

In github I found this possible fix for this:

This is a apktool bug. There are too many files in framework.jar,and the apktool can't process it.
There is a method may resolve it.Please try it.
1.make clean
2."make .build/framework.jar ",and ignore the error.
3."cd .build/","mkdir framework-miui","mv framework/smali/miui framework-miui"
4.use apktool compiles "framework" and "framework-miui",and push the framework.jar and framework-miui.jar to /system/framework
5.modify boot.img and add framework-miui.jar to "init.rc" BOOTCLASSPATH.

But don't work.. So, what can I do now?
[Android Software Development] fedevd:
How? Makeing a new folder called "framework2.jar" and moving some files over there? Will affect the patchrom script? 'cus my doubt is if the patchrom scripts will recognize that new folder and compile it too..

EDIT:

This is my device folder:

I already have those folders. Watch this shell pic..

Enviado desde mi GT-I9070 usando Tapatalk 2
[Android Software Development] ZduneX25:
Do what he said and add proper script for patchrom to let it recognize your changes. Follow other devices to get a sample.

__________

Sent from awesome Galaxy S3
[Android Software Development] fedevd:
#cp other/AxT9IME.apk out/ZIP/system/app
cp stockrom/system/app/FFFFFFFF000000000000000000000001.drbin out/ZIP/system/app
cp: no se puede efectuar `stat' sobre «stockrom/system/app/FFFFFFFF000000000000000000000001.drbin»: No existe el archivo o el directorio
make: *** [local-pre-zip-misc] Error 1
fede@fede-ubuntu:~/patchrom/adv2$

WTF? How can I fix that?

If I remove this from makefile:

#cp other/AxT9IME.apk $(ZIP_DIR)/system/app
cp stockrom/system/app/FFFFFFFF000000000000000000000001.drbin $(ZIP_DIR)/system/app
cp -r stockrom/system/app/mcRegistry $(ZIP_DIR)/system/app
rm -rf $(ZIP_DIR)/system/csc

Could fix that? Or I can't remove that?
[Android Software Development] ZduneX25:
You are facing with the most known problems, so stop being so surprised (expressing wtf in each post).
[Android Software Development] Gerrett:
Why did you ask without trying it o.O

Gesendet von meinem GT-N7000 mit Tapatalk 2
[Android Software Development] fedevd:
You're rite, sorry buddy..

Will not happen again..

I did, I removed that lines but I asked 'cus I'm new on this so I don't know what/how to do and if I ask here is because even my friends don't now how patchrom works.. Plus that, MIUI never was, be, will be friendly to anyone and deleting lines of his scripts because I can't find the object referred isn't a good idea, now, don't wanna mess it up everything, if I know why that lines are in there, that factor changes the idea.. Thats the problem and thats why I ask everything, 'cus MIUI always makes so complicated everything, plus don't do a good guides, explanations, anything.. Watch the HOW TO on his Github, 5 steps and thats all, nothing related to common errors or anything, I know that build roms from source is not like take a rabbit of the pocket but c'mon, MIUI do everyhthing so complicated, PA, CM, helps, gives support, gives info, common errors, common scenarios, all that they can do to make it a bit easier to the users that want to give it a try.. Sorry if I am disturbing here, I gonna leave patchrom for now and try to port from other device 'cus this way looks so hard for now

Enviado desde mi GT-I9070 usando Tapatalk 2
[Android Software Development] Dr01nE:
Yeah. I feel you bro. I've tried and failed.. A video tutorial or AT LEAST an updated and more in-depth tutorial would suffice.
[Android Software Development] cowsquad:
So pretty much this guide doesn't work. Am I right?
[Android Software Development] Dr01nE:
not on my build. it throws an error u have no idea to fix. the instructions are too vague. I get stuck on framework overlays.