dimanche 15 mai 2016

Public Methods Not Accessible on Android 2.3 Devices

This problem is only occurring on Android 2.3.* devices...

Below, "publicMethodName" is the name of a method in the class, that is public.

final Method method = this.getClass().getDeclaredMethod("publicMethodName");
Log.d("XXXD", String.valueOf(method.isAccessible()));

The log outputs "false", again, only on 2.3.* devices. This is a problem, because if isAccessible returns false, it can't be found with the "getMethod" call, which is how the system finds methods to do the onClicks declared in XML...

The app DOES use proguard; however, I can't test to see if that's the problem, as I get multidex and dexopt issues when trying to deploy to a 2.3.* device.





Aucun commentaire:

Enregistrer un commentaire