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

Webview bootstrap can't find 'org.jnius.NativeInvocationHandler'. #2140

Closed
kollivier opened this issue Apr 14, 2020 · 1 comment
Closed

Webview bootstrap can't find 'org.jnius.NativeInvocationHandler'. #2140

kollivier opened this issue Apr 14, 2020 · 1 comment
Labels

Comments

@kollivier
Copy link
Contributor

kollivier commented Apr 14, 2020

Versions

  • Python: 3.7 / 3.8
  • OS: Ubuntu 18.04
  • Kivy: N/A
  • Cython: 0.29.16

Description

While attempting to update a p4a project to the latest version, I discovered that the webview bootstrap is apparently no longer able to load org.jnius.NativeInvocationHandler, which breaks some jnius functionality like PythonJavaClass that our app relies on.

Here is a minimal sample with buildozer.spec and a main.py that shows the problem (the error message should show up in adb logcat logs):

jnius_webview.zip

This sample runs and does not give the error when using the SDL2 bootstrap.

Note also that the example uses the release-2019.10.06 branch of p4a because the latest master branch has an issue with webview bootstrap not having Python 3.8 support, and latest develop ran into an error in the p4a build scripts about a missing method. (Sorry, I forgot to copy it before running more tests and lost it.)

It does reproduce under latest master though with the Python 3.8 issue fixed, and on develop if using p4a commands to build instead of buildozer.

buildozer.spec

Command:

buildozer android debug deploy run

Spec file:

See attached zip.

Logs

04-13 20:50:14.669 23205 23254 I python : Android kivy bootstrap done. name is main
04-13 20:50:14.669 23205 23254 I python : AND: Ran string
04-13 20:50:14.669 23205 23254 I python : Run user program, change dir and execute entrypoint
04-13 20:50:14.757 23205 23254 I python : ERROR:root:Hello world!
04-13 20:50:14.779 23205 23254 I python : Traceback (most recent call last):
04-13 20:50:14.779 23205 23254 I python : File "/home/kevino/code/webview_sample/.buildozer/android/app/main.py", line 9, in
04-13 20:50:14.779 23205 23254 I python : File "/home/kevino/code/webview_sample/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/jnius/reflect.py", line 159, in autoclass
04-13 20:50:14.780 23205 23254 I python : File "jnius/jnius_export_func.pxi", line 26, in jnius.jnius.find_javaclass
04-13 20:50:14.780 23205 23254 I python : jnius.jnius.JavaException: Class not found b'org/jnius/NativeInvocationHandler'
04-13 20:50:14.780 23205 23254 I python : Python for android ended.

Copy link

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.

If you're having trouble installing or using python-for-android, maybe you could be interested in our quickstart guide.

Let us know if this comment was made in error, and we'll be happy to reopen the issue.

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

No branches or pull requests

2 participants