Proguard警告:找不到引用的类scala。*

时间:2011-11-04 13:24:39

标签: java android scala compiler-construction proguard

升级到新的Android工具后,我收到了来自Proguard的警告:

Warning: scala.xml.EntityRef: can't find referenced class scala.xml.EntityRef$$anonfun$text$1
Warning: scala.xml.dtd.AttrDecl$: can't find referenced class scala.xml.dtd.AttrDecl$$anonfun$toString$1
Warning: scala.collection.mutable.LinkedListLike: can't find referenced class scala.collection.mutable.LinkedListLike$$anonfun$insert$1
Warning: scala.xml.NamespaceBinding: can't find referenced class scala.xml.NamespaceBinding$$anonfun$toString$1
Warning: scala.xml.NamespaceBinding: can't find referenced class scala.xml.NamespaceBinding$$anonfun$buildString$1
Warning: scala.xml.MetaData$: can't find referenced class scala.xml.MetaData$$anonfun$toString$1
Warning: scala.xml.MetaData$: can't find referenced class scala.xml.MetaData$$anonfun$toString1$1
Warning: scala.collection.immutable.BitSet: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$plus$1
Warning: scala.collection.immutable.BitSet: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$minus$1
Warning: scala.collection.mutable.FlatHashTable$$anonfun$checkConsistent$1: can't find referenced class scala.collection.mutable.FlatHashTable$$anonfun$checkConsistent$1$$anonfun$apply$mcVI$sp$1
Warning: scala.collection.immutable.RedBlack: can't find referenced class scala.collection.immutable.RedBlack$Empty
Warning: scala.collection.immutable.BitSet$: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$plus$1
Warning: scala.collection.immutable.BitSet$: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$minus$1
Warning: scala.xml.EntityRef$: can't find referenced class scala.xml.EntityRef$$anonfun$text$1
Warning: scala.Either: can't find referenced class scala.Either$$anonfun$joinLeft$1
... (more) ...

为什么Proguard找不到这些课程的任何提示?我该如何解决这个问题?

2 个答案:

答案 0 :(得分:5)

如果从scala-library.jar(版本2.9.1)查看列出的类的内部结构,您将看到它们引用了根本不存在的类。对我来说,它看起来像编译器问题。引用不是处理和运行代码的基础,因此您可以让ProGuard接受使用此选项的jar:

-dontwarn scala.**

答案 1 :(得分:1)

你是如何建造的?用Ant? SBT? Maven的?你从哪里开始设置你的设置?

假设您正在使用Ant和http://lamp.epfl.ch/~michelou/android/中描述的设置,那么您是否已将build-scala.xml和proguard模板更新为最近检查过以支持最新Android SDK的模板?