Joda-Time日历库崩溃问题
博客专区 > Achiever 的博客 > 博客详情
Joda-Time日历库崩溃问题
Achiever 发表于9个月前
Joda-Time日历库崩溃问题
  • 发表于 9个月前
  • 阅读 19
  • 收藏 0
  • 点赞 0
  • 评论 0

标题:腾讯云 新注册用户域名抢购1元起>>>   

最近项目中用到日历控件库 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

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

标签: Joda-Time 崩溃
共有 人打赏支持
粉丝 0
博文 1
码字总数 597
×
Achiever
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: