-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException in Native.getCallingClass() when attempting Direct Mapping on Android #218
Comments
Maybe no one's been using direct mapping? It'd be easy enough to provide a register variant that explicitly provides the class. I ran some tests on a simulator, maybe that has a different security manager implementation? On Apr 15, 2013, at 12:09 PM, Matt Lanting wrote:
|
Maybe - I'm on an actual device and using ndk r8 and the latest (or close to latest) sdk. My SecurityManager assumptions are based on this: http://stackoverflow.com/questions/9403473/attempting-to-get-class-name-on-android-using-getclasscontext1-getname |
Avoid error “The SecurityManager implementation on this platform is broken; you must explicitly provide the class to register” due to stub SecurityManager on Android as described in java-native-access/jna#218 .
Native.register() fails on android with a null pointer exception in Native.getCallingClass(). It looks like the SecurityManager class on android only exists so people can try to call it and get null values (used to be functional, but functionality was removed at some point), so the call to SecurityManager.getClassContext() in getCallingClass() does just that.
I was a little surprised that I didn't see anything about this around here - did I miss something or am I more likely just doing something wrong, or has this not really come up before?
The text was updated successfully, but these errors were encountered: