ProGuard未使用Windows中使用的Joda Time进行编译 [英] ProGuard didnt compile with Joda Time used in Windows

查看:91
本文介绍了ProGuard未使用Windows中使用的Joda Time进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,这是一个答案,而不是一个问题: 我确实在Windows上使用JodaTime花费了很多时间,但是使用ProGuard将其包含在我的Android项目中

Actually this is an answer and not a question anymore: I did spent many hours on Windows using JodaTime to be included in my Android project using ProGuard

Proguard配置:

Proguard Configuration:

-libraryjars C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar

我遇到以下错误:

  1. ProGuard找不到我的JAR并说:

  1. ProGuard didnt find my JAR and said:

Can't read [C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar] (No such file or directory)

解决方案

-libraryjars libs/joda-time-2.1.jar

ProGuard不想编译并抛出很多这样的错误:

ProGuard didnt wanna compile and thrown many line of errors like this:

Warning: org.joda.time.base.AbstractDuration can't find referenced class org.joda.convert.ToString

解决方案

# Exclude those 2 dependency classes, cause otherwise it wont compile

-dontwarn org.joda.convert.FromString

-dontwarn org.joda.convert.ToString

推荐答案

或者作为问题2的解决方案,您可以添加 joda-convert-xxx.jar 中包含的实现.可以在joda-convert主页上找到

Or alternatively as solution for problem 2. you can add an implementation included in joda-convert-xxx.jar. It can be found on the joda-convert homepage

然后将以下行添加到您的proguard配置中:

Then just add a following line into your proguard configuration :

-libraryjars YOUR_DIR_WITHS_JARS/joda-convert-1.3.1.jar

这篇关于ProGuard未使用Windows中使用的Joda Time进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆