简体   繁体   中英

Proguard warnings: can't find referenced class scala.*

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?

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:

-dontwarn scala.**

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM