2017-06-01 81 views
1

我有问题,与我ProGuard的形式Xamarin的项目,我有以下错误:的java.exe”,代码1Xamarin形式的java.exe“退出,代码为1(ProGuard的)

和多个警告退出如:okio.Okio:找不到引用的类java.nio.file.Path

我已经尝试了许多解决方案,例如:

  • 下载最新版本的Proguard的,并且在替换它规格c文件夹。
  • 设置我的Java最大堆大小达到1G
  • 创建我自己的proguard.cfg并设置生成操作ProguardConfiguration

这些解决方案都在工作,我已经尝试过多种清洁和建设,以及。 但有一件事很奇怪,我可以在我的链接设置为“无”而不是“仅限SDK组件”时构建我的项目。当启用ProGuard并将我的链接设置为SDK组件时,它不起作用,是否正常?

这是我的输出构建的例子:

Note: there were 7 references to unknown classes. (TaskId:223) 1> You should check your configuration for typos. (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass) (TaskId:223) 1> Note: there were 2 classes trying to access generic signatures using reflection. (TaskId:223) 1> You should consider keeping the signature attributes (TaskId:223) 1> (using '-keepattributes Signature'). (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes) (TaskId:223) 1> Note: there were 17 unkept descriptor classes in kept class members. (TaskId:223) 1> You should consider explicitly keeping the mentioned classes (TaskId:223) 1> (using '-keep'). (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass) (TaskId:223) 1> Note: there were 10 unresolved dynamic references to classes or interfaces. (TaskId:223) 1> You should check if you need to specify additional program jars. (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass) (TaskId:223) 1> Note: there were 4 accesses to class members by means of introspection. (TaskId:223) 1> You should consider explicitly keeping the mentioned class members (TaskId:223) 1> (using '-keep' or '-keepclassmembers'). (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember) (TaskId:223) 1>PROGUARD : warning : there were 14 unresolved references to classes or interfaces. 1> You may need to add missing library jars or update their versions. (TaskId:223) 1> If your code works fine without the missing classes, you can suppress (TaskId:223) 1> the warnings with '-dontwarn' options. (TaskId:223) 1> (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) (TaskId:223) 1> java.io.IOException: Please correct the above warnings first. (TaskId:223)

这些都是我的警告:

Severity Code Description Project File Line Suppression State Warning there were 14 unresolved references to classes or interfaces. Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning CS0169 The field 'MainActivity.ContextCompat' is never used Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\MainActivity.cs 24 Active Warning CS0067 The event 'Vwm_Listing.PopulateList' is never used Test.App.Forms C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Forms\ViewModels\Vwm_Listing.cs 7 Active Warning okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Path Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Path Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Path Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Path Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.OpenOption Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.OpenOption Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.OpenOption Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.OpenOption Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Files Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Files Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.Okio: can't find referenced class java.nio.file.Files Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Test.App.Droid C:\User\Projects\Test\Test.Mob.App\Test.App\Test.App.Droid\PROGUARD
Warning Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. Test.App.Droid C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 1820

我应该怎么办?我不知道如何解决这个问题..

+0

您使用的是MultiDex吗? – Alexandre

+0

不,我不知道!我应该使用它吗? – Huby03

+0

您是否找到解决方案?这太痛苦了! –

回答

1

发布您的警告error.Also在您的progaurd.pro文件中添加一些行。

-keep class org.apache.http.** { *; } 
-dontnote org.apache.http.** 
-dontwarn org.apache.http.** 
-dontwarn android.net.* 
+0

我没有任何proguard.pro文件...只有 __proguard_input __。罐子 proguard_project_primary.cfg proguard_project_references.cfg proguard_xamarin.cfg – Huby03

+0

@Rims这应该是一个评论。 –

0

我用Square.Picasso库我Xamarin.Android项目没有问题并使用链接设置到SDK和用户组合。

我ProGuard的配置文件中包含的:

-dontwarn org.codehaus.** 
-dontwarn java.nio.file.** 
-dontwarn com.square.** 
-dontwarn okio.** 
-keep public class android.support.v7.widget.FitWindowsLinearLayout 
-keep public class android.support.design.widget.AppBarLayout 

你说,你在你的Android SDK有最新的ProGuard版本,所以它应该工作!

+0

谢谢你,但仍然有“java.exe”错误。我已经跟随你的链接,做了需要的东西!我将不得不挖掘我的日志来发现问题 – Huby03