Proguard 警告:找不到引用的类 scala.*
升级到新的 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 找不到这些类?我该如何解决这个问题?
After upgrading to new Android tools, I am getting following warnings from 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) ...
Any hints why Proguard cannot find these classes? How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您查看 scala-library.jar(版本 2.9.1)中列出的类的内部结构,您会发现它们引用了根本不存在的类。对我来说这看起来像是编译器问题。不过,这些引用对于处理和运行代码来说并不是基础,因此您可以使用此选项让 ProGuard 接受 jar:
If you look at the internals of the listed classes from scala-library.jar (version 2.9.1), you'll see that they reference classes that don't exist at all. It looks like a compiler problem to me. The references are not fundamental for processing and running the code though, so you can let ProGuard accept the jar with this option:
你建设得怎么样?与蚂蚁? SB?马文?您最初是从哪里获得设置的?
假设您正在使用 Ant 以及 http://lamp.epfl.ch/~ 中描述的设置michelou/android/ 那么您是否已将 build-scala.xml 和 proguard 模板更新为最近签入的模板以支持最新的 Android SDK?
How are you building? With Ant? Sbt? Maven? And where did you get your setup from in the first place?
Assuming that you're using Ant and the setup described at http://lamp.epfl.ch/~michelou/android/ then have you updated your build-scala.xml and proguard templates to the ones that were checked in recently to support the latest Android SDK?