Linker error while trying to load ptl model in android native

Hello Everyone,
I am new to the world of pytorch. I am trying to infer a sample pytorch model (converted to ptl) on mobile.

I have referred the link Making Native Android Application that uses PyTorch prebuilt libraries — PyTorch Tutorials 1.11.0+cu102 documentation for building my application.

Instead of using a snapshot of pytorch android (‘org.pytorch:pytorch_android:1.6.0-SNAPSHOT’), I am using latest lite version ('org.pytorch:pytorch_android_lite:1.12.0). I have also modified CmakeLists.txt to search for libpytorch_jni_lite.so instead of pytorch_jni

While building the code, I am getting linker error to the function torch::jit::load(). How do i fix this problem

FAILED: …/…/…/…/build/intermediates/cmake/debug/obj/arm64-v8a/libpytorch_nativeapp.so
: && /home/harshavardhana/ProjectTools/AndroidSdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android28 --gcc-toolchain=/home/harshavardhana/ProjectTools/AndroidSdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/harshavardhana/ProjectTools/AndroidSdk/ndk/21.0.6113669/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 -O0 -fno-limit-debug-info -Wl,–exclude-libs,libgcc_real.a -Wl,–exclude-libs,libatomic.a -static-libstdc++ -Wl,–build-id -Wl,–fatal-warnings -Wl,–no-undefined -Qunused-arguments -shared -Wl,-soname,libpytorch_nativeapp.so -o …/…/…/…/build/intermediates/cmake/debug/obj/arm64-v8a/libpytorch_nativeapp.so CMakeFiles/pytorch_nativeapp.dir/src/main/cpp/pytorch_native.cpp.o …/…/…/…/build/pytorch_android_lite-1.12.aar/jni/arm64-v8a/libpytorch_jni_lite.so -llog -latomic -lm && :
CMakeFiles/pytorch_nativeapp.dir/src/main/cpp/pytorch_native.cpp.o: In function Java_com_example_pytorchnativedemo_PytorchNative_load_1model': /home/harshavardhana/Project/PytorchNativeDemo/app/.cxx/cmake/debug/arm64-v8a/../../../../src/main/cpp/pytorch_native.cpp:40: undefined reference to torch::jit::load(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, c10::optionalc10::Device)’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.