Skip to content
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

luajava.new(...) produce error on Android ART #10

Open
nirhal opened this issue Oct 12, 2016 · 6 comments
Open

luajava.new(...) produce error on Android ART #10

nirhal opened this issue Oct 12, 2016 · 6 comments

Comments

@nirhal
Copy link

nirhal commented Oct 12, 2016

Calling luajava.new(...) produce the following error on Android ART:
A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: can't call static int org.keplerproject.luajava.LuaJavaAPI.javaNew(int, java.lang.Class) with class java.lang.Class<java.lang.Class> A/art: art/runtime/java_vm_ext.cc:410] in call to CallStaticIntMethod

After some code review, I figured out the problem.
In luajava.c, line 1377:
ret = ( *javaEnv )->CallStaticIntMethod( javaEnv , clazz , method , (jint)stateIndex , classInstance );
"clazz" is not the object we want here. It should be:
ret = ( *javaEnv )->CallStaticIntMethod( javaEnv , luajava_api_class , method , (jint)stateIndex , classInstance );

Moreover, I think, line 1371:
if ( clazz == NULL || method == NULL )
should be:
if ( luajava_api_class == NULL || method == NULL )

Nir.

@wangdong
Copy link

Yes, I got this bug too.

@Lee-swifter
Copy link

I've faced the same problem. Thanks for the solution, but this project looks like it's no longer being maintained

@vadi2
Copy link

vadi2 commented Dec 20, 2017

Thanks, that worked for me as well.

@nirhal
Copy link
Author

nirhal commented Jan 25, 2018

Since this project is no longer being maintained, I have forked this project and fixed some bugs.
See here: https://github.com/nirhal/JLua

@ildar
Copy link

ildar commented Jun 16, 2020

@nirhal , your fork has too much in one commit :(
Do you think new users should go on patching this luajava code or jump right into your JLua?
guys?

@ildar
Copy link

ildar commented Jul 13, 2020

BTW looks like @stevedonovan and @mkottman took care of this in AndroLua project. I adapted their works to luajava layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants