- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Xamarin.Forms
项目中,我添加了 ModernHTTPClient
库,现在 ProGuard 步骤因错误而中断:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2025,3):错误 MSB6006:“java.exe”退出并显示代码 1。
(之前,我在使用 ProGuard 时遇到了一些问题,但通过将 ProGuard 升级到最新版本,能够在针对 Android 7.1 的情况下使其正常工作。)
日志文件中的一些详细信息如下。
2> Proguard (TaskId:363)
2> AndroidSdkDirectory: C:\android-sdk\ (TaskId:363)
2> JavaPlatformJarPath: C:\android-sdk\platforms\android-25\android.jar (TaskId:363)
2> ClassesOutputDirectory: obj\Release\android\bin\classes (TaskId:363)
2> AcwMapFile: obj\Release\acw-map.txt (TaskId:363)
2> ProguardGeneratedApplicationConfiguration: obj\Release\proguard\proguard_project_primary.cfg (TaskId:363)
2> ProguardJarInput: obj\Release\proguard\__proguard_input__.jar (TaskId:363)
2> ProguardJarOutput: obj\Release\proguard\__proguard_output__.jar (TaskId:363)
2> ProguardGeneratedReferenceConfiguration: (TaskId:363)
2> obj\Release\proguard\proguard_project_references.cfg (TaskId:363)
2> ProguardGeneratedApplicationConfiguration: (TaskId:363)
2> obj\Release\proguard\proguard_project_primary.cfg (TaskId:363)
2> ProguardCommonXamarinConfiguration: (TaskId:363)
2> obj\Release\proguard\proguard_xamarin.cfg (TaskId:363)
2> ProguardConfigurationFiles: (TaskId:363)
2>
2> {sdk.dir}tools\proguard\proguard-android.txt;
2> {intermediate.common.xamarin};
2> {intermediate.references};
2> {intermediate.application};
2> ;
2> (TaskId:363)
2> ExternalJavaLibraries: (TaskId:363)
2> DoNotPackageJavaLibraries: (TaskId:363)
2> UseProguard: False (TaskId:363)
2> EnableLogging: False (TaskId:363)
2> DumpOutput: obj\Release\proguard\dump.txt (TaskId:363)
2> PrintSeedsOutput: obj\Release\proguard\seeds.txt (TaskId:363)
2> PrintMappingOutput: obj\Release\proguard\mapping.txt (TaskId:363)
2> Environment Variables passed to tool: (TaskId:363)
2> JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 (TaskId:363)
2> C:\Program Files\Java\jdk1.8.0_121\\bin\java.exe -jar C:\android-sdk\tools\proguard\lib\proguard.jar -include C:\android-sdk\\tools\proguard\proguard-android.txt -include obj\Release\proguard\proguard_xamarin.cfg -include obj\Release\proguard\proguard_project_references.cfg -include obj\Release\proguard\proguard_project_primary.cfg "-injars 'obj\Release\proguard\__proguard_input__.jar';'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v7.1\mono.android.jar';'obj\Release\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar';'obj\Release\__library_projects__\OkHttp\library_project_imports\okhttp-2.3.0-jar-with-dependencies.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\embedded\classes.jar';'C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Vector.Drawable\23.3.0.0\embedded\classes.jar'" "-libraryjars 'C:\android-sdk\platforms\android-25\android.jar'" -outjars "obj\Release\proguard\__proguard_output__.jar" -optimizations !code/allocation/variable (TaskId:363)
2> ProGuard, version 5.3.3 (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.Snackbar$Callback$DismissEvent' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.Snackbar$Callback' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.Snackbar$Duration' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.CoordinatorLayout$Behavior' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.CoordinatorLayout$DefaultBehavior' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.internal.NavigationMenuPresenter$NavigationMenuHeaderItem' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.internal.NavigationMenuPresenter$NavigationMenuItem' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.internal.NavigationMenuPresenter$NavigationMenuTextItem' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.internal.NavigationMenuPresenter$ViewHolder' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.AppBarLayout$LayoutParams$ScrollFlags' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.AppBarLayout$OnOffsetChangedListener' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'mono.android.support.design.widget.AppBarLayout_OnOffsetChangedListenerImplementor' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.BottomSheetBehavior$State' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.FloatingActionButton$OnVisibilityChangedListener' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.HeaderBehavior' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.HeaderScrollingViewBehavior' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.NavigationView$OnNavigationItemSelectedListener' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'mono.android.support.design.widget.NavigationView_OnNavigationItemSelectedListenerImplementor' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'android.support.design.widget.SwipeDismissBehavior$OnDismissListener' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'mono.android.support.design.widget.SwipeDismissBehavior_OnDismissListenerImplementor' (TaskId:363)
...
2> Note: the configuration doesn't specify which class members to keep for class 'com.squareup.okhttp.Authenticator' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'com.squareup.okhttp.Callback' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'com.squareup.okhttp.Interceptor$Chain' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'com.squareup.okhttp.Interceptor' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'okio.ForwardingSink' (TaskId:363)
2> Note: the configuration doesn't specify which class members to keep for class 'okio.ForwardingSource' (TaskId:363)
...
2> Reading program jar [C:\Users\user\Desktop\MyProjectXXX\MyProjectXXX.Mobile\MyProjectXXX.Mobile.Android\obj\Release\__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\Desktop\MyProjectXXX\MyProjectXXX.Mobile\MyProjectXXX.Mobile.Android\obj\Release\__library_projects__\OkHttp\library_project_imports\okhttp-2.3.0-jar-with-dependencies.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Design\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.AppCompat\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.MediaRouter\23.3.0.0\embedded\libs\internal_impl-23.3.0.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading program jar [C:\Users\user\AppData\Local\Xamarin\Xamarin.Android.Support.Vector.Drawable\23.3.0.0\embedded\classes.jar] (TaskId:363)
2> Reading library jar [C:\android-sdk\platforms\android-25\android.jar] (TaskId:363)
2> Initializing... (TaskId:363)
2> Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService' (TaskId:363)
2> Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService' (TaskId:363)
2> Note: the configuration refers to the unknown class 'android.support.annotation.Keep' (TaskId:363)
2> Note: the configuration refers to the unknown class 'android.support.annotation.Keep' (TaskId:363)
2> Note: the configuration refers to the unknown class 'android.support.annotation.Keep' (TaskId:363)
2> Note: the configuration refers to the unknown class 'android.support.annotation.Keep' (TaskId:363)
2> Note: the configuration refers to the unknown class 'android.support.annotation.Keep' (TaskId:363)
2> Note: android.support.v4.app.NotificationCompatJellybean calls 'Field.getType' (TaskId:363)
2>PROGUARD : warning : okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
2>PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
...
2> Note: there were 7 references to unknown classes. (TaskId:363)
2> You should check your configuration for typos. (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass) (TaskId:363)
2> Note: there were 1 classes trying to access generic signatures using reflection. (TaskId:363)
2> You should consider keeping the signature attributes (TaskId:363)
2> (using '-keepattributes Signature'). (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes) (TaskId:363)
2> Note: there were 15 unkept descriptor classes in kept class members. (TaskId:363)
2> You should consider explicitly keeping the mentioned classes (TaskId:363)
2> (using '-keep'). (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass) (TaskId:363)
2> Note: there were 9 unresolved dynamic references to classes or interfaces. (TaskId:363)
2> You should check if you need to specify additional program jars. (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass) (TaskId:363)
2> Note: there were 3 accesses to class members by means of introspection. (TaskId:363)
2> You should consider explicitly keeping the mentioned class members (TaskId:363)
2> (using '-keep' or '-keepclassmembers'). (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember) (TaskId:363)
2>PROGUARD : warning : there were 14 unresolved references to classes or interfaces.
2> You may need to add missing library jars or update their versions. (TaskId:363)
2> If your code works fine without the missing classes, you can suppress (TaskId:363)
2> the warnings with '-dontwarn' options. (TaskId:363)
2> (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) (TaskId:363)
2> java.io.IOException: Please correct the above warnings first. (TaskId:363)
2> at proguard.Initializer.execute(Initializer.java:473) (TaskId:363)
2> at proguard.ProGuard.initialize(ProGuard.java:233) (TaskId:363)
2> at proguard.ProGuard.execute(ProGuard.java:98) (TaskId:363)
2> at proguard.ProGuard.main(ProGuard.java:538) (TaskId:363)
2> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 (TaskId:363)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2025,3): error MSB6006: "java.exe" exited with code 1.
2>Done executing task "Proguard" -- FAILED. (TaskId:363)
2>Done building target "_CompileToDalvikWithDx" in project "MyProjectXXX.Mobile.Android.csproj" -- FAILED.: (TargetId:310)
2>
我尝试将 Java 堆大小增加到 1G,但这没有效果。
如果您对如何解决此问题有任何想法,请告诉我。谢谢。
最佳答案
听起来您需要做的就是将一个 proguard.cfg
文件添加到您的项目中,并将构建操作设置为 ProguardConfiguration
以删除任何警告并保留任何必要的类例如:
# General Android
-dontwarn org.apache.http.**
-dontwarn android.net.http.AndroidHttpClient
# Android Support Library
-keep class android.support.multidex.MultiDexApplication
-keep class android.support.v4.**
-keep class android.support.v7.** {
public *;
}
# Google Play Billing
-keep class com.android.vending.billing.**
# Google Play Services
-dontwarn com.google.android.gms.internal.*
-keep class * extends java.util.ListResourceBundle {
protected java.lang.Object[][] getContents();
}
关于xamarin - ProGuard:添加 ModernHTTPClient 后, "java.exe"退出并显示代码 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43393942/
https://www.guardsquare.com/en/proguard/manual/optimizations说 class/unboxing/enum Simplifies enum ty
我想使用 ProGuard 重命名变量和函数。我希望生成的类文件在所有方面都与源 jar 相同,除了名称。有没有办法做到这一点? 我尝试使用 dontoptimize 和 dontshrink 无效。
例如,这条规则在 proguard 中意味着什么: -keep class myjava.** {*;} 我理解 {*;} 部分意味着类中的所有成员和方法。但是包名中的 2 个星号是什么意思? 提前致
我有一个即将使用 ProGuard 混淆的库。 “图书馆模式”几乎适用于我的用例,即保留所有公共(public)和 protected 类和类成员几乎没问题。 然而,由于 Java 的可见性要求,一些
在我的 Playstore 中,我注意到去混淆后的代码包含相当多的 在堆栈跟踪中。 (例如 at .onAttach(ProfileLandingFragment.java) )。 有什么用真正意思?
我收到了一封来自 Google 的关于 unsafe implementation of TrustManager 的电子邮件唯一的线索是有问题的代码在 com.b.a.af 类中。显然,这是混淆的名
我读自 http://proguard.sourceforge.net/manual/usage.html关于assumenosideeffects的使用。我的问题涉及以下段落: -assumenos
什么是智能 ProGuard 配置来混淆特定类 com.acme.Algorithm 的私有(private)方法和常量? 我想对此进行混淆,因为它包含一个算法,当意外打开 .jar 时,该算法不应该
最近将 Pushwoosh 库集成到我的 Android 应用程序中。它运作良好。但是在导出为签名应用程序时遇到以下错误。请帮忙。提前致谢。 Proguard returned with error
有没有人有使用ProGuard的经验是否已经有超出类加载时间的应用程序性能测量? 我有一个相当复杂的应用程序,可能需要改进,但为 ProGuard 准备它需要几天时间,所以我想先听听一些意见。 最佳答
当我尝试使用 android studio 3.2 canary 17 构建应用程序包时,我收到以下错误消息。我不知道我所有的 proguard 文件中缺少什么角括号,一切似乎都很好,并且在旧版本的
我遇到了 proguard 的问题,我刚刚配置了 Bugsense 并且使用了它们的配置建议,我在 google 和 stackoverflow 上进行了搜索,通常 ppl 可以在控制台中看到该行或问
我第一次尝试使用 Proguard,我收到此错误,有人可以帮我吗?谢谢 [2014-09-03 11:44:58 - P - Photos] Proguard returned with error
当我收到此错误时,我正在尝试导出启用了 proguard 的 android 应用程序:- Proguard returned with error code 1. See console pro
看起来有两个用于运行 ProGuard 的 SBT 插件。任何人都可以谈谈他们的相对优势和劣势吗?我还没有在网上找到比较。 xsbt-proguard-plugin - https://github.
Proguard 会条纹 kotlin.Unit 独立对象(在 Kotlin 运行时库中),如果您使用此类型,则会导致编译错误。以下规则无助于保留此元素(可能是因为 Unit 不是一个类,它是一个对象
构建 Android 发行版 apk 时,Smack 4.1 的正确 ProGuard 规则是什么? 目前,我正在使用 aSmack github 存储库上 README.asmack 文件中的 aS
尝试使用 Proguard Maven 插件时出现 OutOfMemoryErrors。我尝试通过将 MAVEN_OPTS 环境变量设置为 -Xmx2g 来为 Maven 分配更多内存,但这没有任何区
我有一个 pom.xml 文件如下。当我运行 mvn clean install 时,出现错误 [proguard] Error: Can't read [C:\Program Files\Java\
我已经将支持库从 v22.2.1 更新到 v23.0.0,在构建应用程序后(使用 minifyEnabled true)我有“AppCompat 不支持当前主题功能”异常: 08-23 05:46:1
我是一名优秀的程序员,十分优秀!