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

libreactnativejni.so is missing when adding the live package #57

Closed
JonathanSum opened this issue Apr 14, 2022 · 11 comments
Closed

libreactnativejni.so is missing when adding the live package #57

JonathanSum opened this issue Apr 14, 2022 · 11 comments
Assignees

Comments

@JonathanSum
Copy link

Version

No response

Problem Area

react-native-pytorch-core (core package)

Steps to Reproduce

  1. Test it on Android
  2. Do all the steps from here https://pytorch.org/live/docs/tutorials/add-package/
  3. Use the Android Studio, run clean build, rebuild, and run
  4. You will see the following Errors

Related: https://stackoverflow.com/questions/44485941/lib-so-missing-and-no-known-rule-to-make-it

Expected Results

  1. Build command failed.
    Error while executing process D:\ADK\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C D:\XXXXXXXXXXX\Main\Project\Project\XXXXXXX\src\mobile\node_modules\react-native-pytorch-core\android.cxx\cmake\debug\armeabi-v7a torchlive}
    ninja: Entering directory `D:\XXXXXXXXXXX\Project\Project\XXXXXXX\src\mobile\node_modules\react-native-pytorch-core\android.cxx\cmake\debug\armeabi-v7a'

ninja: error: '../../../../build/react-native-0.64.3.aar/jni/armeabi-v7a/libreactnativejni.so', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libtorchlive.so', missing and no known rule to make it

  1. If you run the cmake on clion, you will see this warning. I am not sure it is the reason.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FBJNI_LIBRARY
linked by target "torchlive" in directory /cygdrive/d/XXXXXXXXXXX Main/Project/Project/XXXXXXX/src/mobile/node_modules/react-native-pytorch-core/android
PYTORCH_LIBRARY
linked by target "torchlive" in directory /cygdrive/d/XXXXXXXXXXX Main/Project/Project/XXXXXXX/src/mobile/node_modules/react-native-pytorch-core/android
REACT_NATIVE_JNI_LIB
linked by target "torchlive" in directory /cygdrive/d/XXXXXXXXXXX Main/Project/Project/XXXXXXX/src/mobile/node_modules/react-native-pytorch-core/android
REACT_NATIVE_UTILS_LIB
linked by target "torchlive" in directory /cygdrive/d/XXXXXXXXXXX Main/Project/Project/XXXXXXX/src/mobile/node_modules/react-native-pytorch-core/android

Code example, screenshot, or link to repository

No response

@JonathanSum
Copy link
Author

In addition, I also tried to use the newest Live Core. Currently, It still has issues with the CMake:
https://github.com/pytorch/live/blob/main/react-native-pytorch-core/android/CMakeLists.txt

@JonathanSum
Copy link
Author

It is possible that this wrong setting caused this:
image

@Gernii
Copy link

Gernii commented Apr 30, 2022

@JonathanSum u need to up or downgrade your react native to v0.65.1, I have tested all version, and only v0.65.1 work

@JonathanSum
Copy link
Author

@Gernii
I will try your suggestion next week. After that, I will close it, if you are right.

@clarksandholtz
Copy link
Contributor

@JonathanSum any luck with @Gernii's suggestion?

@JonathanSum
Copy link
Author

JonathanSum commented May 20, 2022

@clarksandholtz

It was my final year and final semester of my school, so it was so busy. I am currently starting to try @Gernii's solution.

The RN I am currently using is "react-native": "0.64.3", and I am going to update it.

I hope it can work from 0.65.1 or above.

I will try to fix it this weekend. I am pretty busy right now.

@JonathanSum
Copy link
Author

So it can only work in 0.65.1 at this momoment?

@Gernii
Copy link

Gernii commented May 21, 2022

@JonathanSum v0.1.3 only work with v0.65, i dont know how lib demo work with v0.64, if u want to work in v0.66+, u have to wait for lib next version, if u still want to use in v0.66+ u can use '@nightly'.
Example: react-native-pytorch-core@nightly
This will take latest commit, not latest version, you can see in #50
Warning: this can cause bug because maybe latest commit have bug

@raedle
Copy link
Contributor

raedle commented Jul 14, 2022

@Gernii and @JonathanSum, the latest nightly has support for up to React Native 0.68. React Native 0.69 is not yet supported, but we are also looking into supporting it.

The fix for 0.68 has been added in commit fix RN0.68 can't build with react-native-pytorch-core, which is currently only available in the nightly version.

Please have a look at the docs "Add Package to Existing App" for more information how to set up the project.

Can you let us know if this unblocks you?

@JonathanSum
Copy link
Author

Closing this because my issue was solved in another way.

@JonathanSum
Copy link
Author

@raedle I will try to add it to my project with my OnePlus7 later to see if this unblocks me or not.

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

4 participants