Android 和ICU 5.0_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > Android 和ICU 5.0

Android 和ICU 5.0

 2014/12/19 11:21:34  jlins  程序员俱乐部  我要评论(0)
  • 摘要:我近期在我的android项目中使用ICU4J,在手机上部署的时候,启动后出现错误,信息如下:FATALEXCEPTION:main12345678910111213141516171819202122232425262728293031323334java.lang.ExceptionInInitializerErroratcom.ibm.icu.text.SimpleDateFormat.<clinit>(SimpleDateFormat.java:849)atcom.ibm
  • 标签:android

我近期在我的android 项目中使用 ICU4J,在手机上部署的时候,启动后出现错误,信息如下:

FATAL EXCEPTION: main

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 class="java plain">java.lang.ExceptionInInitializerError    at com.ibm.icu.text.SimpleDateFormat.<clinit>(SimpleDateFormat.java:849)    at com.ibm.icu.text.DateFormat.get(DateFormat.java:1492)    at com.ibm.icu.text.DateFormat.getDateInstance(DateFormat.java:1191)    at com.phonedev.myApp.calendar.TimeCursor.getLongDate(TimeCursor.java:333)    at com.phonedev.myApp.about.VersionInfo.getBuildDateTime(VersionInfo.java:44)    at com.phonedev.myApp.myAppActivity.onCreate(myAppActivity.java:184)    at android.app.Activity.performCreate(Activity.java:5133)    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)    at android.app.ActivityThread.access$600(ActivityThread.java:141)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:137)    at android.app.ActivityThread.main(ActivityThread.java:5103)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:525)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)    at dalvik.system.NativeStart.main(Native Method) Caused by: java.util.MissingResourceException: Could not find the bundle com/ibm/icu/impl/data/icudt50b/en_US      at com.ibm.icu.impl.ResourceBundleWrapper.getBundleInstance(ResourceBundleWrapper.java:109)    at com.ibm.icu.util.UResourceBundle.instantiateBundle(UResourceBundle.java:573)    at com.ibm.icu.util.UResourceBundle.getBundleInstance(UResourceBundle.java:145)    at com.ibm.icu.util.UResourceBundle.getBundleInstance(UResourceBundle.java:228)    at com.ibm.icu.impl.CalendarData.<init>(CalendarData.java:28)    at com.ibm.icu.util.Calendar.setWeekData(Calendar.java:4604)    at com.ibm.icu.util.Calendar.<init>(Calendar.java:1584)    at com.ibm.icu.util.GregorianCalendar.<init>(GregorianCalendar.java:391)    at com.ibm.icu.util.GregorianCalendar.<init>(GregorianCalendar.java:337)    at com.ibm.icu.text.DateFormat$Field.<clinit>(DateFormat.java:1787)    ... 20 more</clinit></init></init></init></init></clinit>

处理方法

我来说下这个问题,下载ICU 所需要的jar,并且全部倒入到工程中,项目缺少class

你需要按照如下步骤 下载 .tgz file that says "gzipped tar archive including the entire source package" U解压文件 使用ant运行 ICU4J build项目 构建成a icu4j.jar file 并放入到项目的lib目录

看起来ICU 源码依赖更多的文件,我把所有的源码都加入进入了,看起来全部解决了。

Edit: Just had these warnings : dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_root' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en_US' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_zoneinfo64' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en_US' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_supplementalData' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en_US' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_res' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en_US' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_res_index' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_@calendar=gregorian' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en' d dvmFindClassByName rejecting 'com/ibm/icu/impl/data/icudt50b_en_US' t threadid=11: thread exiting with uncaught exception (group=0x4176a700)

原文地址:http://www.itmmd.com/201410/32.html   该文章由 萌萌的IT人 整理发布,转载须标明出处。       

发表评论
用户名: 匿名