Reputation: 17382
I want to reduce size of .apk file, so I am checking Enable ProGuard option in Android project's property window but getting compile time errors
Error "java.exe" exited with code 1.
I tried few things like
Log:
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find superclass or interface org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.Instrumentation: can't find referenced class com.appdynamics.eumagent.runtime.BuildInfo
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.Instrumentation: can't find referenced class com.appdynamics.eumagent.runtime.BuildInfo
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.InstrumentationCallbacks: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.Header
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpEntity
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpEntityEnclosingRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.RequestLine
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.StatusLine
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.Header
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.Header
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpEntity
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpEntityEnclosingRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.RequestLine
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.StatusLine
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.StatusLine
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpEntity
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.methods.HttpUriRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.HttpClient
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpHost
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.HttpRequest
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax: can't find referenced class org.apache.http.protocol.HttpContext
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.client.ResponseHandler
8>PROGUARD : warning : com.appdynamics.eumagent.runtime.private.ax$a: can't find referenced class org.apache.http.HttpResponse
8>PROGUARD : warning : there were 123 unresolved references to classes or interfaces.
8>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2550,3): error MSB6006: "java.exe" exited with code 1.
========== Build: 7 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========
I am using proguard 4.7 file. I can't use latest proguard file as I am not allowed to download any external files. How can I fix this issue?
Upvotes: 0
Views: 517
Reputation: 17382
After a long research I have found solutions for this issue.
First download latest Proguard file from here unzip and copy to sdk path C:\Program Files (x86)\Android\android-sdk\tools
, this path could be different in your case.
There must be already one proguard folder, rename that to proguard.old. Now from proguard.old folder copy and paste proguard-android
, proguard-android-optimize
, proguard-project
files to newly created proguard folder.
After that need to follow below steps
.cfg
.If you are getting warnings
with prefix progurd like this
PROGUARD : warning : com.appdynamics.eumagent.runtime.private
Now you need to add this package to your custom proguard.cfg file like
-dontwarn com.appdynamics.eumagent.runtime.**
With -dontwarn
do not use keyword class
. Here **
takes all child classes of given package.
If you are getting exception
then you need to find out which library causing issue and add that in proguard.cfg file with -keep
keyword
-keep public class android.support.v7.widget.** { *; }
If you see your full log carefully progaurd gives all warnings to make us easy to find out issue.
Upvotes: 0