Hello
I am author of
pywebview and am working on adding Android support based on Kivy/Pyjnius/Buildozer. I have some Java code that needs to be included with the library. It works fine as long as I add a jar via
android.add_jars in Buildozer or original Java files via
android.add_src in Buildozer. However, since this is a library, I would like to spare the end-user from extra configuration steps and include the library JAR automatically. I have looked into setting a classpath with j
nius_config.add_classpath, but I get this error
jnius.jnius.JavaException: JVM exception occurred: Didn't find class "com.pywebview.PyWebViewClient" on path: DexPathList[[zip file "/data/app/~~iFWGkcsFbJM8HyitgPBhcg==/com.pywebview.pywebview-ssFZsxemovo9okhxv_gqKw==/base.apk"],nativeLibraryDirectories=[/data/app/~~iFWGkcsFbJM8HyitgPBhcg==/com.pywebview.pywebview-ssFZsxemovo9okhxv_gqKw==/lib/arm64, /data/app/~~iFWGkcsFbJM8HyitgPBhcg==/com.pywebview.pywebview-ssFZsxemovo9okhxv_gqKw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] java.lang.ClassNotFoundException
The code I use is as follows. It is placed before importing jnius and the JAR filepath is correct.
import jnius_config
class_path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'android.jar')
jnius_config.add_classpath('.', class_path)
Any idea what went wrong here? Is this something that can be done via classpath or maybe with the help of a recipe?