gpt4 book ai didi

安卓和 ICU 5.0

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:48 24 4
gpt4 key购买 nike

我开始在我的 Android 项目中使用 ICU4J。但是当我在设备上运行该项目时,在启动时,我遇到了崩溃。这是错误:

 FATAL EXCEPTION: main
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

似乎 ICU 源需要更多文件,但我添加了我在 jar 中找到的所有源...如果有人有同样的问题或只是有解决方案......谢谢!

编辑:刚刚有这些警告:

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

最佳答案

好的,我找到了这个问题的答案。显然,您不能只为 ICU 下载完全构建的 .jar 文件并将其放入。它不包含数据文件。

必须:

  1. 下载 .tgz 文件,上面写着“gzipped tar archive including the entire source package”
  2. 解压缩该文件并 cd 到该目录
  3. 运行“ant”来自己构建 ICU4J
  4. 它将创建一个 icu4j.jar 文件,其中包含您需要的数据文件。您可以将其放入您的 libs 目录并修改您的 gradle build.gradle 文件以包含它

如果在他们网站的某处对此进行了解释,或者如果他们实际提供了包含数据文件的 .jar 文件,将会有所帮助。这导致了大约一天的头痛,所以希望这对其他人有所帮助。

关于安卓和 ICU 5.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18099051/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com