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

Didn't find class "org.able.BLE" #40

Open
sooko opened this issue Jul 14, 2023 · 4 comments
Open

Didn't find class "org.able.BLE" #40

sooko opened this issue Jul 14, 2023 · 4 comments
Labels

Comments

@sooko
Copy link

sooko commented Jul 14, 2023

i came across this problem to day while trying to build to start my new project

Traceback (most recent call last):
07-15 03:04:18.792 5657 5696 I python : File "/home/sooko/prj/git/able/examples/alert/.buildozer/android/app/main.py", line 6, in
07-15 03:04:18.792 5657 5696 I python : File "/home/sooko/prj/git/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/ble/arm64-v8a/able/init.py", line 30, in
07-15 03:04:18.792 5657 5696 I python : File "/home/sooko/prj/git/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/ble/arm64-v8a/able/android/dispatcher.py", line 14, in
07-15 03:04:18.792 5657 5696 I python : File "/home/sooko/prj/git/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/ble/arm64-v8a/jnius/reflect.py", line 209, in autoclass
07-15 03:04:18.792 5657 5696 I python : File "jnius/jnius_export_func.pxi", line 22, in jnius.jnius.find_javaclass
07-15 03:04:18.792 5657 5696 I python : File "jnius/jnius_utils.pxi", line 79, in jnius.jnius.check_exception
07-15 03:04:18.792 5657 5696 I python : jnius.jnius.JavaException: JVM exception occurred: Didn't find class "org.able.BLE" on path: DexPathList[[zip file "/data/app/~~jl-LfZi21GTWADs9WNsRiw==/io.sooko.ble-Yc3olsilIiK7s8JWfe1Q-A==/base.apk"],nativeLibraryDirectories=[/data/app/~~jl-LfZi21GTWADs9WNsRiw==/io.sooko.ble-Yc3olsilIiK7s8JWfe1Q-A==/lib/arm64, /data/app/~~jl-LfZi21GTWADs9WNsRiw==/io.sooko.ble-Yc3olsilIiK7s8JWfe1Q-A==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] java.lang.ClassNotFoundException
07-15 03:04:18.792 5657 5696 I python : Python for android ended.

@b3b
Copy link
Owner

b3b commented Jul 15, 2023

Hi @sooko ,
It seems BLE wasn't included in the build.
Maybe there were some error messages during the buildozer build?
You can try the possible solution of removing the .buildozer directory and then performing a build from a clean page. Hope this helps.

@woutersj
Copy link

I get the same error on a clean build of the alert example. I don't see any error messages in the buildozer log. The installer log indicates at least some files of amble are being installed:

04-21 11:08:52.706 11357 11390 V python  : extracting _python_bundle/site-packages/able/
04-21 11:08:52.707 11357 11390 V python  : extracting _python_bundle/site-packages/able/__init__.pyc
...

Which file should be present to provide org.able.BLE?

@b3b
Copy link
Owner

b3b commented Apr 23, 2024

Hi @woutersj,

BLE.class file should be produced and included in the build. However, this file won't be mentioned in the Android logs.

A successful build can be identified by messages in the buildozer log:

Distribution name found: 'alert_mi'.
...
Java classes directory found: '/.../javaclasses/alert_mi'.
...
Building wheel for able_recipe (pyproject.toml) ... done

It seems this issue arises during the installation process when pip using a cached able_recipe wheel,
leading to the exclusion of Java files from the build.
A new version (able_recipe==1.0.15) should resolve this by renaming the resulting wheel to bypass caching.

Additionally, new Android log messages have been introduced to indicate

  • success: org.able.BLE Java class loaded ,
  • and errors: Failed to load Java class org.able.BLE. Possible build error .

@woutersj
Copy link

woutersj commented Apr 25, 2024 via email

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

3 participants