0

J'ai lu this, Il semble que ce soit un problème connu depuis un certain temps. Mais je ne recevais aucun avertissement ou accident quand je n'utilisais pas pro-guard. Après l'avoir activé, je reçois environ 500 avertissements comme suit;Obtention com.loopj.android.http.AsyncHttpClient après l'activation de Proguard

Attention: com.loopj.android.http.AsyncHttpClient: ne peut pas trouver référencé classe cz.msebera.android.httpclient

J'ai essayé la suite, mais toujours tous les avertissements sont Là. Je n'utilise pas la bibliothèque http-client, mais il y a peut-être une autre bibliothèque que j'utilise dans mon projet pour l'utiliser.

Avertissements

Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpResponse 
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.Header 
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.StatusLine 
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpResponse 
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.HttpEntity 
Warning:com.loopj.android.http.RangeFileAsyncHttpResponseHandler: can't find referenced class cz.msebera.android.httpclient.client.methods.HttpUriRequest 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.protocol.HTTP 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.entity.UrlEncodedFormEntity 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.utils.URLEncodedUtils 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.client.utils.URLEncodedUtils 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.HttpEntity 
Warning:com.loopj.android.http.RequestParams: can't find referenced class cz.msebera.android.httpclient.message.BasicNameValuePair 


Warning:rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.ConcurrentCircularArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.ConcurrentSequencedCircularArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.MpscLinkedQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpmcArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpmcArrayQueueProducerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpscArrayQueue: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpscArrayQueueConsumerField: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.SpscArrayQueueProducerFields: can't find referenced class sun.misc.Unsafe 
Warning:rx.internal.util.unsafe.UnsafeAccess: can't find referenced class sun.misc.Unsafe 
Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate 
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError 
Warning:library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.conn.scheme.HostNameResolver 
Warning:library class org.apache.http.conn.ssl.SSLSocketFactory depends on program class org.apache.http.params.HttpParams 
Warning:library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams 
Warning:there were 757 unresolved references to classes or interfaces. 
Warning:there were 18 instances of library classes depending on program classes. 
Warning:there were 8 unresolved references to program class members. 
Warning:there were 2 unresolved references to library class members. 

Après avoir ajouté les lignes fournies dans Hitesh Gehlot réponse. Je reçois ces 5 avertissements.

Information:Gradle tasks [:app:assembleRelease] 
Warning:com.algolia.search.saas.APIClient: can't find referenced method 'org.json.JSONObject put(java.lang.String,java.util.Collection)' in library class org.json.JSONObject 
Warning:com.algolia.search.saas.Index: can't find referenced method 'org.json.JSONObject put(java.lang.String,java.util.Collection)' in library class org.json.JSONObject 
Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate 
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError 
Warning:there were 3 instances of library classes depending on program classes. 
Warning:there were 2 unresolved references to library class members. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
> java.io.IOException: Please correct the above warnings first. 

Répondre

7

coller ces lignes dans le fichier proguard-rules.pro

-dontwarn com.loopj.android.http.** 
-dontwarn org.apache.http.** 
-dontwarn rx.internal.util.** 
+0

Merci @Hitesh, ces gens prennent l'avertissement de 500+ juste 5. Ce sont maintenant je reçois le 5 avertissement. – Kirmani88

+0

J'ai mis à jour ma question – Kirmani88

+3

-dontwarn com.algolia.search. ** essayer –