-
Notifications
You must be signed in to change notification settings - Fork 469
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
error java.lang.ClassNotFoundException: Didn't find class "org.pytorch.executorch.NativePeer" #8636
Comments
Hi, an update. I added
to If I added
the build failed, as expected, with the following error:
I could be wrong but I think that using the executorch runtime in an Android application may not work for applications other than the executorch android demo because it is hardwired to look for the necessary modules (e.g. I also noticed that
I could be wrong. Shouldn't it be
? Thanks |
Hi Update #2 I worked around the classNotFound exception by creating a Now execution fails producing the error log reported below.
as in the android demo app At this point, I am at a loss as to what I am doing wrong and what I should try next. Should I add and Please let me know if you need additional information. Thanks ERROR LOG
|
Hi @adonnini Just want to clarify, generally for external dependencies for your Android java/kotlin app, you will need an Android library called AAR. An AAR contains java classes (in jar), native libraries (.so), and probably other resources. For ExecuTorch, the .so file itself is not sufficient. The java packages are not present in the .so file. You need the corresponding java files (basically everything you copied in executorch/extension/android/src/main/java/org/pytorch/executorch). You need to compile these files and make it a jar. Then you will combine the so and jar into the AAR. We have a script build/build_android_llm_demo.sh to do that exactly (sorry about the poor naming). |
Please build the AAR and use it in your project. We will overhaul the documentation in #8536, so I will close this specific issue for now. Please re-open if you have further issues. |
Hi,
I tried to run the model produced with executorch using the executorch runtime for Android.
In
/app/src/main/jniLibs/arm64-v8a
for my app I havelibexecutorch.so
created following the instructions inhttps://pytorch.org/executorch/stable/demo-apps-android.html
When I attempt to execute the following command in my application
mModule = Module.load(moduleFileAbsoluteFilePath);
execution fails producing the error log you will find below.
What am I doing wrong? What should I do next? Please let me know if you need additional information.
Thanks
ERROR LOG
cc @kirklandsign @cbilgin @mergennachin @byjlw
The text was updated successfully, but these errors were encountered: