gpt4 book ai didi

android - 导出使用 Proguard 的应用程序时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:03:01 24 4
gpt4 key购买 nike

我尝试在我的应用中使用 Proguard。我在 proguard.cfg 文件中写了这段代码:

    -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 *;
}

当导出应用程序出现找不到引用的类错误时。我在互联网上搜索并添加此行-keep public class Mp4ParserWrapper。 { *; }** proguard 文件但不解决问题。控制台:

[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.**

关于android - 导出使用 Proguard 的应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33172549/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com