I try to resolve this issue last few days, still without success. If I build release version without proguard then everything is OK.
I read many topics about possible problems but nothing help in my case. So far I did as follow:
- Java max heap size - 1G
- Use "mklink" - mklink /j C:\android-sdk “C:\Program Files (x86)\Android\android-sdk”
- Created own proguard.cfg with content:
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(); }
- Manually update ProGuard to latest version.
And the result is 0 warnings and 1 error.
ERROR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1929,3): error MSB6006: "java.exe" exited with code 1.
What else can I do? Please help.
Update. I created brand new app "Xamarin Hello World" and there "ProGuard" works. So it must be something wrong with my app not a system. But visual studio doesn't show me any other error apart that Java code 1. So how to track where is a problem?
UPDATE The problem was in my "proguard.cfg" file. I copy content from other source and one line there should be comment but it wasn't. So this problem gone. But now some warnings come out:
2>PROGUARD : warning : can't write resource [META-INF/MANIFEST.MF](Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])
2>Copying resources from program jar [G:\ApkiC-Sharp\GNote\GNote\GNote.Android\obj\Release\__library_projects__\Xamarin.GooglePlayServices.Basement\library_project_imports\classes.jar](TaskId:345)
2>PROGUARD : warning : can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])
2>Copying resources from program jar [G:\ApkiC-Sharp\GNote\GNote\GNote.Android\obj\Release\__library_projects__\Xamarin.GooglePlayServices.Maps\library_project_imports\classes.jar] (TaskId:345)
2>PROGUARD : warning : can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])
2>Copying resources from program jar [G:\ApkiC-Sharp\GNote\GNote\GNote.Android\obj\Release\__library_projects__\Xamarin.GooglePlayServices.Tasks\library_project_imports\classes.jar] (TaskId:345)
2>PROGUARD : warning : can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])
What dose it mean? Is it something to worried about? How to check if "ProGuard" works fine?