caffeinalab / ti.goosh

GCM/FCM module for Titanium.
MIT License
52 stars 34 forks source link

Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' #80

Closed psylus closed 7 years ago

psylus commented 7 years ago

App is crashing when building with Titanium 6.2.0.GA targeting android 25 I get this message

FATAL EXCEPTION: IntentService[ti.goosh.RegistrationIntentService]
Process: com.test.testapp, PID: 8740
java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/com.test.testapp-2/base.apk)

plugin has to be rebuild with latest play-services.jar? Any workarounds?

Hrfreire commented 7 years ago

Same problem here. The Google Play services provided on gps-jars folder, is out of date for android 25. The Titanium SDK 6.2.0.GA only works targeting android 25 or newer, so it's impossible to update to SDK 6.2.0.GA without resolve this.

Some reference: https://stackoverflow.com/a/40931885

amigoni commented 7 years ago

Having the same issue and can't seem to resolve this even rebuild the services jar with updated proguard. Seems like past 30 you need to create your own jar and I am now attempting to do that. It seems that the issue is that the min version from 6.2.0 is 23

miniman42 commented 7 years ago

Same Issue - I'm using 6.2.1 and was attempting to build a jar, but just don't seem to know what I'm at! I downloaded the "Google Repository" with all the aar's, but when extracted, some have resources and some don't so no Idea what to do with them... Anyone got it working? Please help!

miniman42 commented 7 years ago

Good news folks - fix for me was relatively simple.
SDK 6.2.1 now supports aars (albeit primitively). Remove the proguarded gps.jar from the lib dir and replace it with the following aar's and all should build again nicely for you using cli :
lib/play-services-base-11.0.4.aar
lib/play-services-gcm-11.0.4.aar
lib/play-services-tasks-11.0.4.aar lib/play-services-basement-11.0.4.aar
lib/play-services-iid-11.0.4.aar You can get the aar's by downloding the "Google Repository" using the android sdk manager - 11.0.4 was the latest version in my repository at the time of writing.

You'll have to do similar with other modules that use play services if you use them.

Roll on proper library support (which may be coming? http://docs.appcelerator.com/platform/latest/?mobile=/guide/Android_Module_Project#src-43289002_AndroidModuleProject-UsingAndroidLibraries )

Hrfreire commented 7 years ago

@miniman42 Thank you! This really works!

Jei commented 7 years ago

@miniman42 thank you! We are trying to implement this solution. See #82

Jei commented 7 years ago

This issue should be solved in the v3.0.0 release of the module. @psylus could you please check if it works for you?

psylus commented 7 years ago

Yes it seems to work, thank you!

Jei commented 7 years ago

Nice!