警告:org.apache.poi.hssf.usermodel.DummyGraphics2d

时间:2018-12-15 11:10:02

标签: android proguard

当我尝试从Proguard使用这些错误和警告时,APK文件无法建立:

警告:

  

org.apache.poi.hssf.usermodel.DummyGraphics2d:找不到超类   或接口java.awt.Graphics2D
  org.apache.poi.hssf.usermodel.EscherGraphics:找不到超类或   接口java.awt.Graphics
  org.apache.poi.hssf.usermodel.EscherGraphics2d:找不到超类   或接口java.awt.Graphics2D
  org.apache.poi.sl.draw.DrawSimpleShape $ 1:找不到超类或   接口javax.xml.stream.EventFilter
  org.apache.poi.sl.draw.Drawable $ DrawableHint:找不到超类或   接口java.awt.RenderingHints $ Key   org.apache.poi.sl.draw.PathGradientPaint:找不到超类或   接口java.awt.Paint
  org.apache.poi.sl.draw.PathGradientPaint $ PathGradientContext:不能   查找超类或接口java.awt.PaintContext
  org.apache.poi.sl.draw.SLGraphics:找不到超类或接口   java.awt.Graphics2D org.apache.poi.sl.draw.geom.PresetGeometries $ 1:   找不到超类或接口javax.xml.stream.EventFilter
  com.fasterxml.jackson.databind.ext.DOMSerializer:找不到   引用的类org.w3c.dom.bootstrap.DOMImplementationRegistry
  com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.Transient   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.ConstructorProperties   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.Transient   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.ConstructorProperties   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.Transient   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.ConstructorProperties   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.Transient   com.fasterxml.jackson.databind.ext.Java7SupportImpl:找不到   引用的类java.beans.ConstructorProperties   io.jsonwebtoken.impl.Base64Codec:找不到引用的类   javax.xml.bind.DatatypeConverter
  io.jsonwebtoken.impl.crypto.EllipticCurveProvider:找不到   引用的类org.bouncycastle.jce.ECNamedCurveTable
  org.apache.poi.ddf.EscherMetafileBlip:找不到引用的类   java.awt.Rectangle org.apache.poi.ddf.EscherMetafileBlip:找不到   引用的类java.awt.Dimension
  org.apache.poi.ddf.EscherMetafileBlip:找不到引用的类   java.awt.Rectangle org.apache.poi.ddf.EscherMetafileBlip:找不到   引用的类java.awt.Dimension
  org.apache.poi.ddf.EscherPictBlip:找不到引用的类   java.awt.Rectangle org.apache.poi.ddf.EscherPictBlip:找不到   引用的类java.awt.Dimension

错误:

  

java.lang.RuntimeException:作业失败,有关详细信息,请参见日志。   com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:207)     在   com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:239)     在   com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:235)     在   org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)     在java.lang.Thread.run(Thread.java:745)造成原因:   java.io.IOException:请首先更正以上警告。在   proguard.Initializer.execute(Initializer.java:485)在   proguard.ProGuard.initialize(ProGuard.java:271)位于   proguard.ProGuard.execute(ProGuard.java:113)在   com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:64)     在   com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:262)     在   com.android.build.gradle.internal.transforms.ProGuardTransform.access $ 000(ProGuardTransform.java:65)     在   com.android.build.gradle.internal.transforms.ProGuardTransform $ 1.run(ProGuardTransform.java:176)     在com.android.builder.tasks.Job.runTask(Job.java:47)处   com.android.build.gradle.tasks.SimpleWorkQueue $ EmptyThreadContext.runTask(SimpleWorkQueue.java:41)     在com.android.builder.tasks.WorkQueue.run(WorkQueue.java:282)... 1   更多

proguad-rules.pro文件

# apache
-keep public class org.apache.poi.** {*;}

出什么问题了?

1 个答案:

答案 0 :(得分:0)

-dontwarn org.apache.poi.**

这为我解决了这个问题。