isuPatches / android-wisefy

Wrapper around WifiManager and ConnectivityManager for Android
Apache License 2.0
312 stars 38 forks source link

IllegalAccessError / conflict with GCM 8.3.0 library #55

Closed jewom closed 7 years ago

jewom commented 7 years ago

Hi,

First, thanks for all, I love your library and it's working good with a new project :)

When I add the library in an old project, after the compilation I have this error :

FATAL EXCEPTION: IntentService[GCM] Process: my.app, PID: 7667 java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/my.app-1/base.apk:classes2.dex) at com.google.android.gms.iid.zzd.zzdL(Unknown Source) at com.google.android.gms.iid.zzd.(Unknown Source) at com.google.android.gms.iid.zzd.(Unknown Source) at com.google.android.gms.iid.InstanceID.zza(Unknown Source) at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) at gcm.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:54) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.os.HandlerThread.run(HandlerThread.java:61)

This is the line of the problem :

InstanceID instanceID = InstanceID.getInstance(this); I have look the reason of this error and it seem it's because I use a version too old of my play-services.

compile 'com.google.android.gms:play-services:8.3.0' But it's working without adding the lib wisefy so how can I isolate this problem because I don't want to update my library ?

isuPatches commented 7 years ago

Oh! Interesting...yes, there is a conflict that is coming from the compile 'com.android.support:appcompat-v7:25.3.1' in WiseFy. I don't think we actually need the support libraries for anything at this time, so I'm okay with removing it for now until it's actually in use.

I'll push an update, but an alternative would be to exclude the version of appcompat-v7 that WiseFy is bringing in.

jewom commented 7 years ago

Thanks a lot ! How can I exclude the version of appcompat-v7 that WiseFy is bringing in ?

isuPatches commented 7 years ago

This should do it until I release 1.0.10:

compile ('com.isupatches:wisefy:1.0.9') {
      exclude module: 'appcompat-v7'
}

Thanks for reporting everything :)

jewom commented 7 years ago

Thanks it's working :)

isuPatches commented 7 years ago

Should be okay in 1.0.10 as well