导出使用Proguard的应用程序时出错 [英] Error when exporting app that used Proguard

查看:238
本文介绍了导出使用Proguard的应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的应用中使用Proguard.我在proguard.cfg文件中编写了以下代码:

I try to use Proguard in my app. I wrote this code in proguard.cfg file:

    -optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class   Mp4ParserWrapper.** { *; }
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
    native <methods>;
}
-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

当导出应用程序出现找不到引用的类错误时,我在互联网上搜索并添加了以下行:-保留公共类Mp4ParserWrapper. {*; } **保护文件,但不能解决问题. 控制台:

When export app get can't find referenced class error .I search on the internet and add this line -keep public class Mp4ParserWrapper. { *; }** to proguard file but don't solve problem . Console :

[2015-10-16 17:29:09 - nabege] Proguard returned with error code 1. See console
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class javax.imageio.ImageIO
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class javax.imageio.ImageIO
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class java.awt.image.BufferedImage
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class java.awt.image.BufferedImage
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class java.awt.image.BufferedImage
[2015-10-16 17:29:09 - nabege] Warning: com.googlecode.mp4parser.authoring.tracks.mjpeg.OneJpegPerIframe: can't find referenced class java.awt.image.BufferedImage
[2015-10-16 17:29:09 - nabege]       You should check if you need to specify additional program jars.
[2015-10-16 17:29:09 - nabege] Warning: there were 6 unresolved references to classes or interfaces.
[2015-10-16 17:29:09 - nabege]          You may need to specify additional library jars (using '-libraryjars').
[2015-10-16 17:29:09 - nabege] java.io.IOException: Please correct the above warnings first.
[2015-10-16 17:29:09 - nabege]  at proguard.Initializer.execute(Initializer.java:321)
[2015-10-16 17:29:09 - nabege]  at proguard.ProGuard.initialize(ProGuard.java:211)
[2015-10-16 17:29:09 - nabege]  at proguard.ProGuard.execute(ProGuard.java:86)
[2015-10-16 17:29:09 - nabege]  at proguard.ProGuard.main(ProGuard.java:492)
[2015-10-16 17:29:09 - nabege] Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m

推荐答案

您需要添加-dontwarn com.googlecode.mp4parser.**

这篇关于导出使用Proguard的应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆