2017-06-01 80 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