-
Notifications
You must be signed in to change notification settings - Fork 256
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
"Class not found" when trying to access a class from .AAR imported with Gradle #544
Comments
I'm seeing very similar behavior with AAR or with Java classes that are directly in my project, with pyjnius 1.3.0. Classes are present in the generated APK (as seen with an APK decompiler), yet the error I run into at runtime is the following:
After a lot of digging, it seems that the issue comes from imports that are not in the main thread. Moving all my imports to the top of my files, so that they are executed when the app is loaded, appears to have fixed it. |
@lerela, I just wanted to say that you probably saved me days of work. I am working on a project that is multiplatform, and some of the android code ended up in a different thread and hadn't been tested for months. It was a complete mystery why pyjnius was failing, now that we were testing android again, and almost all of the dependencies for this project had changed, so I had a huge pile of things to go through. I wouldn't have figured this out any time soon. Thank you |
👋 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. |
A bit of history: trying to make TensorFlow Lite work on Android. The way they recommend isn't working for like 9 months now, and currently isn't a priority for them (issue). So the only thing left to try is adding an .AAR file and using the classes through pyjnius. Guide 1, guide 2, .AAR downloaded from here.
And when I do that, I get
jnius.jnius.JavaException: Class not found b'org/tensorflow/lite'
.It is worth noting that I get libpythonXXX.so not found when I try to build with any version of TFLite .AAR for armeabi-v7a, which may be a separate issue and is probably harder to debug than this one. When I build other stuff, both arm64-v8a and armeabi-v7a builds work on my phone fine.
Tried 5 different versions of TFLite, two newest versions of Buildozer, p4a master/develop, cleaned everything multiple times, but no luck. Will be grateful for any tips.
Also, I may just be doing it all wrong, since I haven't found much info for such a case. So excuse my ignorance, if I missed something obvious.
The text was updated successfully, but these errors were encountered: