Rebuilding's ICU's .dat file

123 views
Skip to first unread message

Jeffrey Blattman

unread,
Sep 27, 2018, 4:37:12 PM9/27/18
to android-porting
Android 8.1.

I need to re-build ICU's icudt58l.dat file because someone decided that Canada should really have a 24 hour clock. I did this on an Android 5.1 source tree by making changes to the locales/... file I needed, then doing a "make" in icu4c/source/data. When I do this on our Android 8.1 tree, the build go fine, but when I plop the .dat file on the device it won't boot and gets this,

 09-27 15:12:14.667 E/Zygote  ( 8313): System zygote died with exception 
 09-27 15:12:14.667 E/Zygote  ( 8313): java.lang.ExceptionInInitializerError 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.lang.UCharacter.getUnicodeVersion(UCharacter.java:3877) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.text.StringPrep.<init>(StringPrep.java:277) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.text.StringPrep.getInstance(StringPrep.java:314) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.IDNA2003.<clinit>(IDNA2003.java:37) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at java.lang.Class.classForName(Native Method) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at java.lang.Class.forName(Class.java:453) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at com.android.internal.os.ZygoteInit.preloadClasses(ZygoteInit.java:300) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:128) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
 09-27 15:12:14.667 E/Zygote  ( 8313): Caused by: java.util.MissingResourceException: could not locate data 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.ICUData.getStream(ICUData.java:145) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.ICUBinary.getData(ICUBinary.java:499) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.ICUBinary.getRequiredData(ICUBinary.java:453) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.UCharacterProperty.<init>(UCharacterProperty.java:1221) 
 09-27 15:12:14.667 E/Zygote  ( 8313): at android.icu.impl.UCharacterProperty.<clinit>(UCharacterProperty.java:1437) 
 09-27 15:12:14.667 E/Zygote  ( 8313): ... 9 more 

I also tried re-building with zero changes to any source files and had the same problem. The resulting .dat file is ~3k smaller that the one in stubdata.

Any ideas?

Bkav Chat

unread,
May 22, 2019, 11:06:32 AM5/22/19
to android-porting

I got the same issue wth my Android 8.1 source. In my case, because in the icudt58l.dat has no ubidi.icu file, MissingResourceException is thrown.


In the Makefile, ubidi.icu is included by UNI_CORE_DATA and only is built ifneq ($(INCLUDE_UNI_CORE_DATA),).


That is, you have to include INCLUDE_UNI_CORE_DATA in the make command.


make INCLUDE_UNI_CORE_DATA=1


And Here is all the commands that I use:


cd external/icu/icu4c

mkdir build

cd build

../source/runConfigureICU Linux --with-data-packaging=archive

# work around if there is no xlocale.h file in your environment
sudo ln -s /usr/include/locale.h /usr/include/xlocale.h

make INCLUDE_UNI_CORE_DATA=1

adb root; adb remount; adb push ./data/out/icudt58l.dat system/usr/icu/icudt58l.dat

adb shell stop; adb shell start

Bkav Chat

unread,
May 22, 2019, 11:06:32 AM5/22/19
to android-porting
Have you found the solution yet? I got the same issue with Android 8.1.

cd external/icu/icu4c

mkdir build

cd build

../source/configure

# work around because there is no xlocale.h
sudo ln -s /usr/include/locale.h /usr/include/xlocale.h

make -j16

adb push ./data/out/tmp/icudt58l.dat system/usr/icu/icudt58l.dat

adb reboot


On Friday, September 28, 2018 at 3:37:12 AM UTC+7, Jeffrey Blattman wrote:
Reply all
Reply to author
Forward
0 new messages