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

static jfieldID not valid for class java.lang.Class<org.renpy.android.PythonActivity> #686

Closed
brussee opened this issue Mar 14, 2016 · 4 comments

Comments

@brussee
Copy link
Contributor

brussee commented Mar 14, 2016

libsdl.app.SDLActivity.nativeInit(java.lang.Object) seems to do something wrong in call to GetStaticObjectField.
I noticed a deprecated message right before the crash occurred:

W/PythonActivity(11234): Accessing org.renpy.android.PythonActivity is deprecated and will be removed in a future version. Please switch to org.kivy.android.PythonActivity.
A/art(11234): art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: static jfieldID 0xb06734f0 not valid for class java.lang.Class<org.renpy.android.PythonActivity>
A/art(11234): art/runtime/java_vm_ext.cc:410]     in call to GetStaticObjectField
A/art(11234): art/runtime/java_vm_ext.cc:410]     from int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object)
A/art(11234): art/runtime/java_vm_ext.cc:410] "SDLThread" prio=5 tid=11 Runnable
A/art(11234): art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x12e10d60 self=0xacbbdb00
A/art(11234): art/runtime/java_vm_ext.cc:410]   | sysTid=11264 nice=0 cgrp=default sched=0/0 handle=0xa0db7930
A/art(11234): art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 3880685778 149162400 802 ) utm=373 stm=15 core=1 HZ=100
A/art(11234): art/runtime/java_vm_ext.cc:410]   | stack=0xa0cb5000-0xa0cb7000 stackSize=1038KB
A/art(11234): art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #00 pc 00370e01  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+160)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #01 pc 0035046f  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+150)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #02 pc 0025a725  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+740)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #03 pc 0025adfd  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+64)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #04 pc 000fd1d1  /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+32)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #05 pc 00114ab1  /system/lib/libart.so (art::ScopedCheck::CheckFieldAccess(art::ScopedObjectAccess&, _jobject*, _jfieldID*, bool, art::Primitive::Type)+452)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #06 pc 001164d5  /system/lib/libart.so (art::CheckJNI::GetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type)+524)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #07 pc 00116a6f  /system/lib/libart.so (art::CheckJNI::GetStaticObjectField(_JNIEnv*, _jclass*, _jfieldID*)+30)
A/art(11234): art/runtime/java_vm_ext.cc:410]   native: #08 pc 002e1ce4  /data/data/org.tribler.android/files/libpymodules.so (???)
A/art(11234): art/runtime/java_vm_ext.cc:410]   at org.libsdl.app.SDLActivity.nativeInit(Native method)
A/art(11234): art/runtime/java_vm_ext.cc:410]   at org.libsdl.app.SDLMain.run(SDLActivity.java:929)
A/art(11234): art/runtime/java_vm_ext.cc:410]   at java.lang.Thread.run(Thread.java:818)
A/art(11234): art/runtime/java_vm_ext.cc:410] 
A/art(11234): art/runtime/runtime.cc:366] Runtime aborting...
@brussee
Copy link
Contributor Author

brussee commented Mar 15, 2016

Using --copy-libs I got to know it is somewhere in /org.tribler.android/files/lib/python2.7/site-packages/jnius/jnius.so (???)
However it still says ??? instead of class and line number.

Complete adb log: http://pastebin.com/JQBe3LAi

W/PythonActivity(8828): Accessing org.renpy.android.PythonActivity is deprecated and will be removed in a future version. Please switch to org.kivy.android.PythonActivity.
A/art(8828): art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: static jfieldID 0xb0673040 not valid for class java.lang.Class<org.renpy.android.PythonActivity>
A/art(8828): art/runtime/java_vm_ext.cc:410]     in call to GetStaticObjectField
A/art(8828): art/runtime/java_vm_ext.cc:410]     from int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object)
A/art(8828): art/runtime/java_vm_ext.cc:410] "SDLThread" prio=5 tid=11 Runnable
A/art(8828): art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x12dd70a0 self=0xacbbdb00
A/art(8828): art/runtime/java_vm_ext.cc:410]   | sysTid=8898 nice=0 cgrp=default sched=0/0 handle=0xa0cb9930
A/art(8828): art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 4916090891 117910460 866 ) utm=458 stm=33 core=0 HZ=100
A/art(8828): art/runtime/java_vm_ext.cc:410]   | stack=0xa0bb7000-0xa0bb9000 stackSize=1038KB
A/art(8828): art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #00 pc 00370e01  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+160)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #01 pc 0035046f  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+150)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #02 pc 0025a725  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+740)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #03 pc 0025adfd  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+64)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #04 pc 000fd1d1  /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+32)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #05 pc 00114ab1  /system/lib/libart.so (art::ScopedCheck::CheckFieldAccess(art::ScopedObjectAccess&, _jobject*, _jfieldID*, bool, art::Primitive::Type)+452)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #06 pc 001164d5  /system/lib/libart.so (art::CheckJNI::GetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type)+524)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #07 pc 00116a6f  /system/lib/libart.so (art::CheckJNI::GetStaticObjectField(_JNIEnv*, _jclass*, _jfieldID*)+30)
A/art(8828): art/runtime/java_vm_ext.cc:410]   native: #08 pc 00056260  /data/data/org.tribler.android/files/lib/python2.7/site-packages/jnius/jnius.so (???)
A/art(8828): art/runtime/java_vm_ext.cc:410]   at org.libsdl.app.SDLActivity.nativeInit(Native method)
A/art(8828): art/runtime/java_vm_ext.cc:410]   at org.libsdl.app.SDLMain.run(SDLActivity.java:929)
A/art(8828): art/runtime/java_vm_ext.cc:410]   at java.lang.Thread.run(Thread.java:818)
A/art(8828): art/runtime/java_vm_ext.cc:410] 

@brussee
Copy link
Contributor Author

brussee commented Mar 15, 2016

Thanks to @tito and @kived for tracking this down!

The problem is not in p4a but the fact that PythonActivity = autoclass('org.kivy.android.PythonActivity') actually returns class org.renpy.android.PythonActivity and its static field mActivity is moved.

@xxnet
Copy link

xxnet commented Mar 29, 2016

How can we do to for this problem?

@cidermole
Copy link
Contributor

Would somebody please release a new plyer to https://pypi.python.org? pip install gets plyer-1.2.4 which is not compatible with the current kivy, because it triggers this bug.

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

3 participants