启用 PROGUARD - Xamarin.Android

Posted

技术标签:

【中文标题】启用 PROGUARD - Xamarin.Android【英文标题】:Enabling PROGUARD - Xamarin.Android 【发布时间】:2017-12-22 08:46:21 【问题描述】:

在发布模式下,当我启用only multi dex时,我的应用大小为 33.30MB,相当大。经过一系列研究,我意识到 PROGUARD 缩小了 apk 大小。 在我的解决方案中启用 proguard,我收到此错误。为了使 PROGUARD 正常工作(缩小我的应用程序大小),我的解决方案中可能缺少什么?

PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find superclass or interface com.flurry.android.ads.FlurryAdNativeListener
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find superclass or interface com.inmobi.ads.InMobiNative$NativeAdListener
PROGUARD : warning : com.google.android.gms.internal.zzx$zza: can't find superclass or interface org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.FlurryAgent
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.FlurryAgent
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.FlurryAgent
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdErrorType
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNativeAsset
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNativeListener
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdErrorType
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNativeAsset
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdNative
PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find referenced class com.flurry.android.ads.FlurryAdErrorType
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative$NativeAdListener
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.sdk.InMobiSdk
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.sdk.InMobiSdk
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiAdRequestStatus
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative$NativeAdListener
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiAdRequestStatus
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiAdRequestStatus
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.adapters.q$1: can't find referenced class com.inmobi.ads.InMobiNative
PROGUARD : warning : com.facebook.ads.internal.view.d.c.a: can't find referenced method 'DefaultTrackSelector(android.os.Handler,com.google.android.exoplayer2.trackselection.TrackSelection$Factory)' in program class com.google.android.exoplayer2.trackselection.DefaultTrackSelector
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.ProtocolVersion
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHeader
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicStatusLine
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.ProtocolVersion
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.entity.BasicHttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHeader
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicHttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.message.BasicStatusLine
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzaa: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzad: can't find referenced class android.net.http.AndroidHttpClient
PROGUARD : warning : com.google.android.gms.internal.zzad: can't find referenced class android.net.http.AndroidHttpClient
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.impl.cookie.DateUtils
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.impl.cookie.DateUtils
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.StatusLine
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.HttpEntity
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzu: can't find referenced class org.apache.http.Header
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.HttpClient
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpDelete
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpGet
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpHead
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpOptions
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPost
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPut
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpTrace
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.entity.ByteArrayEntity
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced method 'void addHeader(java.lang.String,java.lang.String)' in program class com.google.android.gms.internal.zzx$zza
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpDelete
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpGet
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpHead
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpOptions
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPost
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPost
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPost
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPut
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpPut
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpTrace
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.entity.ByteArrayEntity
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.HttpClient
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.HttpClient
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.HttpClient
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpUriRequest
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzx$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzx$zza: can't find referenced method 'void setURI(java.net.URI)' in program class com.google.android.gms.internal.zzx$zza
PROGUARD : warning : com.google.android.gms.internal.zzx$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
PROGUARD : warning : com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.impl.cookie.DateParseException
PROGUARD : warning : com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.impl.cookie.DateUtils
PROGUARD : warning : com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.impl.cookie.DateUtils
PROGUARD : warning : com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpResponse
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int splash_wrapper_rl' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int logo' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int header_tv' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int footer_tv' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int before_logo_tv' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : gr.net.maroulis.library.EasySplashScreen: can't find referenced field 'int after_logo_tv' in program class gr.net.maroulis.library.R$id
PROGUARD : warning : okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Files
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
PROGUARD : warning : okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.Path
PROGUARD : warning : okio.Okio: can't find referenced class java.nio.file.OpenOption
PROGUARD : warning : okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
PROGUARD : warning : there were 156 unresolved references to classes or interfaces. 

proguard.cfg

Environment Variables passed to tool:
      PROGUARD_HOME=/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/proguard
    /usr/bin/java -jar /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/proguard/lib/proguard.jar -include /Users/emmnock/AndroidStudioProjects/android-sdk-macosx//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 -include proguard.cfg -include obj/Release/XbdMerge/proguard/00d975c90.txt -include obj/Release/XbdMerge/proguard/0757626b0.txt -include obj/Release/XbdMerge/proguard/1db418320.txt -include obj/Release/XbdMerge/proguard/1f4fd9cc0.txt -include obj/Release/XbdMerge/proguard/211c61910.txt -include obj/Release/XbdMerge/proguard/2f4d086a0.txt -include obj/Release/XbdMerge/proguard/581878c90.txt -include obj/Release/XbdMerge/proguard/67b1d0a90.txt -include obj/Release/XbdMerge/proguard/8f1de9cb0.txt -include obj/Release/XbdMerge/proguard/a35ed7280.txt -include obj/Release/XbdMerge/proguard/acdd43380.txt -include obj/Release/XbdMerge/proguard/b76e0d310.txt -include obj/Release/XbdMerge/proguard/c756521f0.txt -include obj/Release/XbdMerge/proguard/d87effcf0.txt -include obj/Release/XbdMerge/proguard/d99a9fda0.txt -include obj/Release/XbdMerge/proguard/d9f2c52f0.txt -include obj/Release/XbdMerge/proguard/dc663e480.txt -include obj/Release/XbdMerge/proguard/e5bf18810.txt -include obj/Release/XbdMerge/proguard/e843ef2a0.txt -include obj/Release/XbdMerge/proguard/fb4df8d50.txt "-injars 'obj/Release/proguard/__proguard_input__.jar':'/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v7.1/mono.android.jar':'obj/Release/__library_projects__/Bolts.AppLinks/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/Bolts.Tasks/library_project_imports/bolts-tasks.jar':'obj/Release/__library_projects__/EasySplashScreen/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/ExoPlayer/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/FormsViewGroup/library_project_imports/formsviewgroup.jar':'obj/Release/__library_projects__/Glide/library_project_imports/glide-3.8.0.jar':'obj/Release/__library_projects__/Refractored.Controls.CircleImageView/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/Square.OkHttp/library_project_imports/okhttp.jar':'obj/Release/__library_projects__/Square.OkIO/library_project_imports/okio.jar':'obj/Release/__library_projects__/Square.Picasso/library_project_imports/picasso-2.5.2.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Animated.Vector.Drawable/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Compat/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Core.UI/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Core.Utils/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.CustomTabs/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Design/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Fragment/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Media.Compat/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Transition/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.Vector.Drawable/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v4/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v7.AppCompat/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v7.CardView/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v7.MediaRouter/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v7.Palette/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Android.Support.v7.RecyclerView/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Facebook/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/Xamarin.Facebook.AudienceNetwork/library_project_imports/bin/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Analytics/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Analytics.Impl/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Auth/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Common/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Database/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Database.Connection/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Iid/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Storage/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.Firebase.Storage.Common/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Ads/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Ads.Lite/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Base/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Basement/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Clearcut/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Gass/library_project_imports/classes.jar':'obj/Release/__library_projects__/Xamarin.GooglePlayServices.Tasks/library_project_imports/classes.jar'" "-libraryjars '/Users/emmnock/AndroidStudioProjects/android-sdk-macosx/platforms/android-25/android.jar'" -outjars "obj/Release/proguard/__proguard_output__.jar" -optimizations !code/allocation/variable 
    proguard.ParseException: Unknown option '-dontwarn' in line 1 of file 'proguard.cfg',
      included from argument number 10
        at proguard.ConfigurationParser.parse(Unknown Source)
        at proguard.ProGuard.main(Unknown Source)
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1922,3): error MSB6006: "java" exited with code 1.
  Done executing task "Proguard" -- FAILED.

【问题讨论】:

请上传完整的诊断构建输出。developer.xamarin.com/guides/android/troubleshooting/… @JonDouglas gist.github.com/anonymous/91176f39efaf73c7322f21d20547ffff 看起来您可能只需要在您的 proguard.cfg 文件中添加一些例外,这是一个示例 ***.com/questions/43393942/… 【参考方案1】:

Proguard 告诉您,您需要先修复警告,然后它才会允许它构建。

   java.io.IOException: Please correct the above warnings first.
        at proguard.Initializer.execute(Unknown Source)
        at proguard.ProGuard.initialize(Unknown Source)
        at proguard.ProGuard.execute(Unknown Source)
        at proguard.ProGuard.main(Unknown Source)

您可以逐个修复所有这些错误(通过使用-keep),也可以忽略警告。有两种方法可以解决这个问题:

    使用-ignorewarnings

指定打印有关未解决的引用和其他重要问题的任何警告,但在任何情况下都继续处理。忽视警告可能很危险。例如,如果确实需要处理未解析的类或类成员,则处理后的代码将无法正常运行。仅当您知道自己在做什么时才使用此选项!

https://www.guardsquare.com/en/proguard/manual/usage#ignorewarnings

    使用-dontwarn [class_filter]

指定根本不警告未解决的引用和其他重要问题。可选过滤器是一个正则表达式; ProGuard 不会打印有关名称匹配的类的警告。忽视警告可能很危险。例如,如果确实需要处理未解析的类或类成员,则处理后的代码将无法正常运行。仅当您知道自己在做什么时才使用此选项!

https://www.guardsquare.com/en/proguard/manual/usage#dontwarn

您可以通过我编写的文档了解如何创建自定义 proguard 配置:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#Customizing_ProGuard

为什么会收到您可能会问的那些警告?这很可能是由于链接器在运行 Proguard 之前剥离了这些项目。在这里查看我的笔记:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/proguard/#Linker_Step

【讨论】:

所以我基本上可以创建一个custom proguard configuration 来解决这个问题? 试试看。最初,您可以从-ignorewarnings 开始,看看这是否能让您的构建工作。然后你就可以解决剩下的问题了:) 请查看我正在使用的错误 - ignorewarings 见:***.com/questions/38743557/…

以上是关于启用 PROGUARD - Xamarin.Android的主要内容,如果未能解决你的问题,请参考以下文章

使用启用了 proguard 的 GSON

启用 ProGuard 规则时 Gson 解析不起作用

如何在android studio中启用proguard? [复制]

了解启用 Proguard 的崩溃和 ANR

启用 Proguard 时未找到 kotlin.Any

启用 proguard 后调试应用程序构建失败