pyjnius
pyjnius copied to clipboard
org/kivy/android/PythonActivity java.lang.NoClassDefFoundError
Hi I am trying to implement Java in Python using Pyjnius
My code:
PythonActivity = autoclass('org.kivy.android.PythonActivity')
currentActivity = cast('android.app.Activity', PythonActivity.mActivity)
context = cast('android.content.Context', currentActivity.getApplicationContext())
While running i am getting below exception
> PythonActivity = autoclass('org.kivy.android.PythonActivity')
sarasds/ds_init/DataStoreInit.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/jnius/reflect.py:229: in autoclass
c = find_javaclass(clsname)
jnius/jnius_export_func.pxi:26: in jnius.find_javaclass
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E jnius.JavaException: JVM exception occurred: org/kivy/android/PythonActivity java.lang.NoClassDefFoundError
jnius/jnius_jvm_dlopen.pxi:91: JavaException
How to fix this?
you are trying to use a android only code in a non android device
I am getting a similar error, i am using android 13.
Agree with @takipsizad about the log snipped captured by the original author.
@Blackysh , please open a new issue and provide the log snipped captured via adb logcat
on your Android 13 device.