Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Android Build Error #42

Open
Znerual opened this issue May 28, 2023 · 1 comment
Open

Android Build Error #42

Znerual opened this issue May 28, 2023 · 1 comment

Comments

@Znerual
Copy link

Znerual commented May 28, 2023

Dear Niranjan,
thank you so much for sharing this project! It's extremely helpful to have a base on which to build ones ideas and I would love to expand on the android app part of your project.
Unfortunately, I can't get your original project to run. I unzipped the android_app folder and opened it in Android Studio. I use Java SDK 11, NDK 21.4 (have also tried 25.1). The gradle build successfully finishes, but when I run the app I get the linker error from the native-lib.cpp:

: && /home/ruzickal/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=x86_64-none-linux-android29 --sysroot=/home/ruzickal/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -frtti -fexceptions -fno-limit-debug-info  -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--gc-sections -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libnative-lib.so -o /home/ruzickal/StudioProjects/android_whisper_app_orig/Whisper-TFLIte-Android-Example/app/build/intermediates/cmake/debug/obj/x86_64/libnative-lib.so CMakeFiles/native-lib.dir/native-lib.cpp.o  /home/ruzickal/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/29/liblog.so /home/ruzickal/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/29/libandroid.so /home/ruzickal/StudioProjects/android_whisper_app_orig/Whisper-TFLIte-Android-Example/app/src/main/cpp/tf-lite-api/generated-libs/x86_64/libtensorflowlite.so -latomic -lm && :

ld: error: undefined symbol: tflite::InterpreterBuilder::operator()(std::__ndk1::unique_ptr<tflite::Interpreter, std::__ndk1::default_delete<tflite::Interpreter> >*)
>>> referenced by native-lib.cpp:254 (/home/ruzickal/StudioProjects/android_whisper_app_orig/Whisper-TFLIte-Android-Example/app/src/main/cpp/native-lib.cpp:254)
>>>               CMakeFiles/native-lib.dir/native-lib.cpp.o:(Java_com_whisper_android_tflitecpp_MainActivity_loadModelJNI)

which indicates that the linker can't find the tflite InterpreterBuilder or has another problem with it. Do you maybe have an idea what could be the problem?

And does anybody else face the same issue and has anyone solved it?

I would greatly appreciate your help!
All the best,
Laurenz

@nyadla-sys
Copy link
Contributor

looks like libtensorflowlite.so is not linked to the project

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

No branches or pull requests

2 participants