Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analytics broken on Marshmallow?

I'm using analytics and while compiling I get this proguard warnings:

Warning: com.google.android.gms.internal.zzw$zza: can't find superclass or interface org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning: com.google.android.gms.analytics.internal.zzam: can't find referenced class org.apache.http.NameValuePair
Warning: com.google.android.gms.analytics.internal.zzam: can't find referenced class org.apache.http.client.utils.URLEncodedUtils

and much more.

I'm using these dependencies:

compile 'com.google.android.gms:play-services-base:7.8.0'
compile 'com.google.android.gms:play-services-gcm:7.8.0'

Is this a bug? Is there any workaround for that?

like image 426
rekire Avatar asked Aug 18 '15 07:08

rekire


2 Answers

Adding to proguard

-keep public class com.google.android.gms.**
-dontwarn com.google.android.gms.**

seems to fix

like image 155
Stefano Avatar answered Oct 13 '22 00:10

Stefano


I think if you add the legacy Http support to the build.gradle of your app (just inside the android section) then it should resolve the issue until GMS and other libraries move to the non-removed classes

android {
    useLibrary 'org.apache.http.legacy' // Need until GMS upgraded
}

See this page for official documentation.

like image 24
Barry Irvine Avatar answered Oct 13 '22 00:10

Barry Irvine