如何在发布模式下导出APK时解决以下错误?

时间:2015-08-13 08:00:37

标签: android android-proguard

    :app:proguardDebug
Warning:com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable

Warning:com.google.common.collect.Collections2: can't find referenced class javax.annotation.Nullable

Warning:com.google.common.collect.Tables$UnmodifiableTable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeBasedTable$TreeRow: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultimap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Aggregate$2: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$AvlNode: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeMultiset$Reference: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$AsMapOfRanges: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$SubRangeMap: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeMap$SubRangeMap$SubRangeMapAsMap$1: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$AsRanges: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$ComplementRangesByLowerBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$RangesByUpperBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$SubRangeSet: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.TreeRangeSet$SubRangeSetRangesByLowerBound: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.collect.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.escape.ArrayBasedUnicodeEscaper: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.escape.Escapers$Builder: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.escape.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.eventbus.AnnotatedSubscriberFinder$MethodIdentifier: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.eventbus.EventSubscriber: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.BloomFilter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Funnels$SequentialFunnel: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Funnels$StringCharsetFunnel: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.HashCode: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Hashing$ConcatenatedHashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Murmur3_128HashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.Murmur3_32HashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.SipHashFunction: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.hash.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.html.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.io.AppendableWriter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.BaseEncoding: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.io.BaseEncoding$StandardBaseEncoding: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CharSource: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.Closeables: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.Closer: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CountingInputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.CountingOutputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.MultiInputStream: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.MultiReader: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.PatternFilenameFilter: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.io.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.math.MathPreconditions: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.math.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.net.HostAndPort: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.HostAndPort: can't find referenced class javax.annotation.concurrent.Immutable
Warning:com.google.common.net.HostSpecifier: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.InetAddresses$TeredoInfo: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.InternetDomainName: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.MediaType: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.net.MediaType: can't find referenced class javax.annotation.concurrent.Immutable
Warning:com.google.common.net.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.primitives.Doubles: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.Floats: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.Ints: can't find referenced class javax.annotation.CheckForNull
Warning:com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator: can't find referenced class sun.misc.Unsafe
Warning:com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1: can't find referenced class sun.misc.Unsafe
Warning:com.google.common.primitives.UnsignedInteger: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.primitives.UnsignedInteger: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.UnsignedLong: can't find referenced class javax.annotation.CheckReturnValue
Warning:com.google.common.primitives.UnsignedLong: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.primitives.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
Warning:com.google.common.reflect.AbstractInvocationHandler: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.ClassPath$Scanner: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Element: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable$ConstructorInvokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.Invokable$MethodInvokable: can't find referenced class javax.annotation.Nullable
Warning:com.google.common.reflect.MutableTypeToInstanceMap: can't find referenced class javax.annotation.Nullable

Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Request$Builder
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Response
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class 
Warning:there were 1326 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
:app:proguardDebug FAILED
Error:Execution failed for task ':app:proguardDebug'.
> java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED
Information:Total time: 8.387 secs
Information:1 error
Information:536 warnings
Information:See complete output in console

2 个答案:

答案 0 :(得分:21)

禁用proguard配置中的警告 -

-dontwarn javax.annotation.**

其他警告也一样。

答案 1 :(得分:0)

如果您对依赖项非常有信心 您也可以使用:

-ignorewarnings

This proguard option只会忽略它们来处理所有潜在的警告。