文档章节

Joda-Time日历库崩溃问题

Achiever
 Achiever
发布于 2017/05/04 19:10
字数 597
阅读 21
收藏 0

最近项目中用到日历控件库 Joda-Time,三个开发在自己本地使用库没问题,但是合并起来,问题来了.

 

W/NativeCrashHandler: Load library failed.

我去 library没load进来! 导致接下来的错误
W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
E/dalvikvm:Could not find class 'org.joda.time.DateTime', referenced from method com.jeek.calendar.widget.calendar.month.MonthAdapter.getYearAndMonth

W/dalvikvm: VFY: unable to resolve new-instance 9220 (Lorg/joda/time/DateTime;) in Lcom/jeek/calendar/widget/calendar/month/MonthAdapter;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x0003
W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0xf6f8 at 0x05 in Lcom/jeek/calendar/widget/calendar/month/MonthAdapter;.getYearAndMonth

dex文件,联想到难道是方法量或引入库太大?!
W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
E/dalvikvm: Could not find class 'org.joda.time.DateTime', referenced from method com.jeek.calendar.widget.calendar.week.WeekAdapter.initStartDate
W/dalvikvm: VFY: unable to resolve new-instance 9220 (Lorg/joda/time/DateTime;) in Lcom/jeek/calendar/widget/calendar/week/WeekAdapter;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x0000
W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
I/dalvikvm: Could not find method org.joda.time.DateTime.plusWeeks, referenced from method com.jeek.calendar.widget.calendar.week.WeekAdapter.instanceWeekView
 W/dalvikvm: VFY: unable to resolve virtual method 63286: Lorg/joda/time/DateTime;.plusWeeks (I)Lorg/joda/time/DateTime;
 D/dalvikvm: VFY: replacing opcode 0x6e at 0x000f
 W/dalvikvm: Unable to resolve superclass of Lorg/joda/time/DateTime; (9277)
 W/dalvikvm: Link of class 'Lorg/joda/time/DateTime;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0xf6f8 at 0x02 in Lcom/jeek/calendar/widget/calendar/week/WeekAdapter;.initStartDate

崩溃就在这里了
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x415cdd88)
E/CatchException:Unabletostartactivity

ComponentInfo{growUp.GrowUpActivity}: android.view.InflateException: Binary XML file line #120: Error inflating class com.jeek.calendar.widget.calendar.week.WeekCalendarView
E/CatchException: 异常跟踪: [Ljava.lang.StackTraceElement;@46162828
E/CatchException:: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2237)
E/CatchException:: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
1in E/CatchException: 异常跟踪: android.app.ActivityThread.access$800(ActivityThread.java:144)
1in E/CatchException:: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
1in E/CatchException: 异常跟踪: android.os.Handler.dispatchMessage(Handler.java:102)
1in E/CatchException: 异常跟踪: android.os.Looper.loop(Looper.java:212)
1in E/CatchException: 异常跟踪: android.app.ActivityThread.main(ActivityThread.java:5137)
1in E/CatchException: 异常跟踪: java.lang.reflect.Method.invokeNative(Native Method)
1in E/CatchException: 异常跟踪: java.lang.reflect.Method.invoke(Method.java:515)
1inE/CatchException:: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
1in E/CatchException: 异常跟踪: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718)
1in E/CatchException: 异常跟踪: dalvik.system.NativeStart.main(Native Method)

 

死了好多脑细胞,终于看找到了解决方案

1,使用最新的joda-time 库  github.com/JodaOrg/joda-time/releases

2,在app的build.gradle中 defaultconfig中加  multiDexEnabled true

3,  也是最最最重要的一步,项目的application需要继承   MultiDexApplication

问题解决了!问题解决了!问题解决了!

© 著作权归作者所有

共有 人打赏支持
Achiever
粉丝 0
博文 1
码字总数 597
作品 0
海淀
程序员
私信 提问
Joda-Time v2.6 发布,Java 日期时间处理库

Joda-Time v2.6 发布了,该版本主要改进内容包括: - 处理复杂的前缀和后缀合并 [#194, #203] 例如 'M' 代表月份,而 'm' 代表分钟 Parser 一般情况下是大小写不敏感的,但在这种场景下是敏感...

oschina
2014/12/02
3.1K
3
Joda-Time v2.8.2 发布,Java 日期时间处理库

Joda-Time v2.8.2 发布,该版本带来了新的提升,bug 修复等等,主要如下: - DateTimeZone data updated to version 2015f 更多内容请看:change notes 下载地址:v2.8.2 JodaTime 提供了一组...

oschina
2015/08/12
1K
3
Joda-Time v2.8 发布,Java 日期时间处理库

Joda-Time v2.8 发布,该版本完全兼容 2.7 版本,主要改进包括: 1. 使用 Unicode 对 properties 文件进行转义 2. 避免 Android jar 包中的 ProGuard 错误 JodaTime 提供了一组Java类包用于处...

oschina
2015/05/30
3.3K
13
Joda-Time 2.9.2 发布,Java 日期时间处理库

Joda-Time 2.9.2 发布,更新如下: Bug fixes in 2.9.2 ------------------ - Fix bug in time-zone binary search [#332] - DateTimeZone data updated to version 2016a (version 2.9 had ......

淡漠悠然
2016/01/29
1K
3
Joda-Time 2.9.4 发布,Java 日期时间处理库

Joda-Time 2.9.4 发布了,更新内容如下: Changes in 2.9.4 ---------------- - DateTimeZone data updated to version 2016d - Loading time-zone provider now occurs in a priveleged bloc......

xusheng1987
2016/06/01
2.5K
8

没有更多内容

加载失败,请刷新页面

加载更多

CentOS 安装PHP5和PHP7

安装PHP5 下载解压二进制包 [root@test-a src]# cd /usr/local/src/[root@test-a src]# wget http://cn2.php.net/distributions/php-5.6.32.tar.bz2[root@test-a src]# tar jxvf php-5.6......

野雪球
57分钟前
3
0
windows上类似dnsmasq的软件Dual DHCP DNS Server

官网地址:http://dhcp-dns-server.sourceforge.net/官网定向的下载地址:https://sourceforge.net/projects/dhcp-dns-server/files/ 设置参考地址:http://blog.51cto.com/zhukeqiang/18264......

xueyuse0012
今天
3
0
LinkedHashMap源码解析

前言 HashMap中的元素时无序的,也就是说遍历HashMap的时候,顺序和放入的顺序是不一样的。 如果需要有序的Map,就可以采用LinkedHashMap. LinkedHashMap通过维护一个包含所有元素的双向链表,...

grace_233
今天
3
0
初识flask

文档 0.10.1版本 http://www.pythondoc.com/flask/index.html 1.0.2版本 https://dormousehole.readthedocs.io/en/latest/ 安装flask $ pip3 install flaskCollecting flask Downloading......

yimingkeji
昨天
5
0
Akka系统《sixteen》译

Actor是一个封装状态(state)和行为(behavior)的对象,它们只通过交换消息通信(放入收件人邮箱的邮件)。从某种意义上说,Actor是最严格的面向对象编程形式,但它更适合将他们视为人:在与Act...

woshixin
昨天
3
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部