Re: Framework.jar is full!

5,914 views
Skip to first unread message
Message has been deleted

Asi Mugrabi

unread,
Jul 17, 2012, 11:22:21 AM7/17/12
to android-...@googlegroups.com
I am also running into problems in building. Applied the patch above.
But now I am getting errors:
target Java: services (out/target/common/obj/JAVA_
LIBRARIES/services_intermediates/classes)
frameworks/base/services/java/com/android/server/accessibility/TouchExplorer.java:20: package android.gesture does not exist
import android.gesture.Gesture;
                      ^
frameworks/base/services/java/com/android/server/accessibility/TouchExplorer.java:21: package android.gesture does not exist
import android.gesture.GestureLibraries;

As if the build is not able to find required files from framework2
 
Any idea would be much appriciated


On Wednesday, July 11, 2012 11:18:38 PM UTC+3, Steve Kondik wrote:
The dex format has a cap of 65536 methods per file. Jelly Bean is very close to hitting the limit with framework.jar, and with customization exceeds the limit. The solution we've come up with for CyanogenMod was to split classes that don't have a direct dependency on the framework itself  into a separate jar. This seems like an ugly solution, but changing the dex format to accommodate more classes isn't trivial. I suspect that OEMs will quickly hit this issue as well.

I'm wondering if Google has an "official" solution to this problem?


Asi Mugrabi

unread,
Jul 17, 2012, 11:32:08 AM7/17/12
to android-...@googlegroups.com
I forgot to add that I am building x86

Asi Mugrabi

unread,
Jul 18, 2012, 3:01:50 AM7/18/12
to android-...@googlegroups.com
Great, thanks. That was the missing link.

On Wednesday, July 18, 2012 4:48:39 AM UTC+3, krarvind wrote:
https://github.com/CyanogenMod/android_build/commit/a75d678c0347ee0cc6959781e85af9d6498fdd3d



On Tuesday, July 17, 2012 7:48:16 AM UTC-3, sahil suri wrote:
What changes require in build folder

On Tuesday, 17 July 2012 00:49:31 UTC+5:30, iceandfire wrote:
I'm still running into the same problem. Even after apply this patch and the other patch in Build folder.

Any ideas?

Asi Mugrabi

unread,
Jul 18, 2012, 6:47:19 AM7/18/12
to android-...@googlegroups.com
Hi krarvind,

Just as iceandfire below, after successful build emulator gets stucked in loop with the error
W/Zygote  ( 2023): Class not found for preloading: android.media.AudioManager$2
E/JNIHelp ( 2023): Native registration unable to find class 'android/media/videoeditor/VideoEditorProfile', aborting
F/libc    ( 2023): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2023 (zygote)

Any ideas?

Thanks,
Asi

On Tuesday, July 17, 2012 2:25:26 AM UTC+3, krarvind wrote:
did you delete the common obj/java libraries/framework_intermediates and device /ob/java libraries/framework_intermediates and try? if so, try clobber and rebuild.

Asi Mugrabi

unread,
Jul 18, 2012, 7:51:24 AM7/18/12
to android-...@googlegroups.com
I will answer myself.
Check the post of krarvind answered by Raymond Hong
https://groups.google.com/forum/?fromgroups#!topic/android-platform/4qHMBrI88YU

Asi Mugrabi

unread,
Jul 18, 2012, 8:25:00 AM7/18/12
to android-...@googlegroups.com
check for errors using adb logcat
The two patches from the discussion and the changes to build/core/dex_preopt.mk and system/core/rootdir/init.rc should solve the problem.

On Wednesday, July 18, 2012 3:08:13 PM UTC+3, iceandfire wrote:
I'm a little confused about it. I've followed @Asi's post. I've added what was required.

How to check what's causing the boot loop if the above stated doesn't solve the error?
Message has been deleted

Raymond Hong

unread,
Jul 19, 2012, 9:00:03 PM7/19/12
to android-...@googlegroups.com
Fix something.
AOSP provides LOCAL_JARJAR_RULES flag.
zap or keep rules may help us to divide framework.jar to two .jar files.

2012년 7월 20일 금요일 오전 9시 56분 58초 UTC+9, Raymond Hong 님의 말:
Who has an idea about jarjar jar repackaging tool? Please see the details at http://code.google.com/p/jarjar/.
AOSP already supports it by using jarjar-rules.txt.
Message has been deleted

sahil suri

unread,
Jul 20, 2012, 5:34:09 AM7/20/12
to android-...@googlegroups.com
Hi arvind ,

 I am facing some problem in booting getting below errors :

Class not found for preloading: android.media.AudioManager$2
E/JNIHelp ( 3067): Native registration unable to find class 'android/media/videoeditor/VideoEditorProfile', aborting
F/libc    ( 3067): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 3067 (zygote)
I/DEBUG   ( 1386): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1386): Build fingerprint: 'ste/ste_u8500/u8500:4.1.1/JRO03C/eng.ssuri000.20120720.112953:eng/tes 3067, tid: 3067, name: zygote  >>> zygote <<<

I have already made changes in build/core/dex_preopt.mk and system/core/rootdir/init.rc. please help

Raymond Hong

unread,
Nov 18, 2012, 10:07:24 PM11/18/12
to android-...@googlegroups.com
There is more details about jarjar I told long ago. Regarding the status of 4.2 (JB MR 1) please refer to https://groups.google.com/d/topic/android-platform/qRCDsFCjfzc/discussion.
I hope anybody at Google or AOSP answer this thread.

Basic procedure is like below:
1) build framework.jar with all source codes
2) extract some packages/classes from framework.jar and make framework2.jar by using jarjar tool before running dex tool.
3) add framework2.jar to BOOTCLASSPATH and DEXPREOPT_BOOT_JARS. this was already told.

There are something to do for 2)
1) build/target/product/core.mk
PRODUCT_PACKAGES += framework2
2) frameworks/base/Android.mk
include $(CLEAR_VARS)
...
LOCAL_SRC_FILES := ... # all java files for framework.jar
          ...
# files to be removed from framework.jar
framework2_candidate := \
telephony/java/com/android/internal/telephony/% \
...
framework2_srcs := $(filter $(framework2_candidate), $(LOCAL_SRC_FILES))
LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt 
... 
 
LOCAL_MODULE := framework
...
include $(BUILD_JAVA_LIBRARY)
...
framework_built := $(call java-lib-deps,framework)
framework_built += $(call java-lib-deps,framework2)
...
framework_docs_LOCAL_JAVA_LIBRARIES += framework2
...
framework_docs_LOCAL_ADDITIONAL_JAVA_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
framework_docs_LOCAL_ADDITIONAL_JAVA_DIR += $(call intermediates-dir-for,JAVA_LIBRARIES,framework2,,COMMON) 
... 
include $(CLEAR_VARS)

LOCAL_MODULE := framework2
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(framework2_srcs)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit ext framework
LOCAL_DX_FLAGS := --core-library
LOCAL_NO_EMMA_INSTRUMENT := true
LOCAL_NO_EMMA_COMPILE := true

include $(BUILD_JAVA_LIBRARY)
3)  frameworks/base/jarjar-rules.txt
zap com.android.internal.telephony.**
4)  frameworks/base/tools/layoutlib/Android.mk
built_framework_dep := $(call java-lib-deps,framework)
built_framework_classes := $(call java-lib-files,framework)
...
built_framework_dep += $(call java-lib-deps,framework2)
built_framework_classes += $(call java-lib-files,framework2)
5) build/core/java.mk
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
    LOCAL_JAVA_LIBRARIES := core core-junit ext framework framework2 $(LOCAL_JAVA_LIBRARIES)
endif
6) build/core/droiddoc.mk
...
else
  LOCAL_JAVA_LIBRARIES := core ext framework framework2 $(LOCAL_JAVA_LIBRARIES)
endif  # LOCAL_SDK_VERSION

Raymond 

2012년 9월 10일 월요일 오후 10시 48분 49초 UTC+9, Mateor 님의 말:
This has been working for us, but as of 9/09/2012, the additions we add to the framework.jar again put it over the limit.

The split into framework2.jar created some space, but I am going to need some more space. That means that this is coming down the pipe to everyone else sooner rather than later.

CM, even after splitting the framework.jar into two, is only has 250 methods breathing room. My projest can no longer fit in this space.

Any suggestions? It looks like Steve moved all the classes he could. I have heard that there are some rils I can move pver to buy some time?

Ron M

unread,
Nov 19, 2012, 3:46:56 AM11/19/12
to android-...@googlegroups.com
AFAIK this has also been solved in 4.1
> --
> You received this message because you are subscribed to the Google Groups
> "android-platform" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-platform/-/uhuWGEGhLkIJ.
>
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-platfo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-platform?hl=en.

Raymond Hong

unread,
Nov 21, 2012, 1:10:32 AM11/21/12
to android-...@googlegroups.com
Can I know how it was solved in 4.1? methods count was about 65,000 in 4.1.1_r1 and that of 4.2_r1 is about 61,000.

2012년 11월 19일 월요일 오후 5시 47분 23초 UTC+9, Ron M 님의 말:

Jean-Baptiste Queru

unread,
Nov 26, 2012, 1:28:12 PM11/26/12
to android-...@googlegroups.com
IIRC, some functionality was moved to separate libraries
(mms-common.jar and telephony-common.jar, I think). If I'm not
mistaken, this had been available in the AOSP master since last July.

JBQ
> https://groups.google.com/d/msg/android-platform/-/miNqBn8ys1UJ.
>
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-platfo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-platform?hl=en.



--
Jean-Baptiste M. "JBQ" Queru
Technical Lead, Android Open Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Steve Kondik

unread,
Jul 11, 2012, 4:18:38 PM7/11/12
to android-...@googlegroups.com

krarvind

unread,
Jul 16, 2012, 6:59:17 AM7/16/12
to android-...@googlegroups.com
Figured it out. Had to make the changes in build. Cheers

On Sunday, July 15, 2012 10:29:31 PM UTC-3, krarvind wrote:
Steve,
Thanks for the workaround. However i ran into issues compiling gallery2 and musicfx, seems it can't find package android.media.effect does not exist, it's as if the new changes weren't compiled for framework2, although framework2.jar did get created. Any ideas?
Thanks

krarvind

unread,
Jul 16, 2012, 7:25:26 PM7/16/12
to android-...@googlegroups.com
did you delete the common obj/java libraries/framework_intermediates and device /ob/java libraries/framework_intermediates and try? if so, try clobber and rebuild.

On Monday, July 16, 2012 4:19:31 PM UTC-3, iceandfire wrote:
I'm still running into the same problem. Even after apply this patch and the other patch in Build folder.

Any ideas?

On Thursday, July 12, 2012 1:48:38 AM UTC+5:30, Steve Kondik wrote:

Fr Ch

unread,
Jul 16, 2012, 11:56:23 PM7/16/12
to android-...@googlegroups.com
Post your dump. I think that would help


On Monday, July 16, 2012 12:19:31 PM UTC-7, iceandfire wrote:
I'm still running into the same problem. Even after apply this patch and the other patch in Build folder.

Any ideas?

On Thursday, July 12, 2012 1:48:38 AM UTC+5:30, Steve Kondik wrote:

iceandfire

unread,
Jul 17, 2012, 4:00:17 AM7/17/12
to android-...@googlegroups.com
Doing make clean solved it. Thanks

krarvind

unread,
Jul 17, 2012, 9:48:39 PM7/17/12
to android-...@googlegroups.com
What changes require in build folder

On Tuesday, 17 July 2012 00:49:31 UTC+5:30, iceandfire wrote:
I'm still running into the same problem. Even after apply this patch and the other patch in Build folder.

Any ideas?

On Thursday, July 12, 2012 1:48:38 AM UTC+5:30, Steve Kondik wrote:

sahil suri

unread,
Jul 17, 2012, 11:28:33 PM7/17/12
to android-...@googlegroups.com, krar...@gmail.com
Hi arvind,

I am getting errors ,as some packages not able to find classes in Framework2.
I guess some changes require in build also. please suggest

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/5EHm1fbat8oJ.

sahil suri

unread,
Jul 18, 2012, 3:06:43 AM7/18/12
to android-...@googlegroups.com
Thanks its working for me also.
1 more question on what basis packages have been added into framework2 .
If I need to add more packages into framework2 then what need to check ?

iceandfire

unread,
Jul 18, 2012, 4:45:38 AM7/18/12
to android-...@googlegroups.com
Okay I added both the patches. The rom compiled but doesn't boot. Sticks at the boot animation! I had built it after doing make clean. What could it be? 


On Tuesday, July 17, 2012 4:55:26 AM UTC+5:30, krarvind wrote:

krarvind

unread,
Jul 18, 2012, 7:49:18 AM7/18/12
to android-...@googlegroups.com
@ Ice and fire and asi:

you need to play with the packages you put in framework.jar, i had to move video editor out of framework2.jar for eg; and if you are compiling for nexus/galaxys variants, use libhwcomposer.so from ICS.

iceandfire

unread,
Jul 18, 2012, 8:08:13 AM7/18/12
to android-...@googlegroups.com
I'm a little confused about it. I've followed @Asi's post. I've added what was required.

How to check what's causing the boot loop if the above stated doesn't solve the error?

lambu0594

unread,
Jul 18, 2012, 10:01:14 AM7/18/12
to android-...@googlegroups.com
yes i had the same problem dexpreopt.mk and init.rc solves the problem

sahil suri

unread,
Jul 19, 2012, 7:23:38 AM7/19/12
to android-...@googlegroups.com
I had make changes in  dexpreopt.mk and init.rc still device doesnot boot !!!

Raymond Hong

unread,
Jul 19, 2012, 8:56:58 PM7/19/12
to android-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages