react-native-tensorflow
react-native-tensorflow copied to clipboard
can not load resoure in release apk
I follow the code in your example, it work fine when i react-native run-android
。
But,when i build in release version。
error, can't load resource
react-native bundle --entry-file App.js --platform android --dev false --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/
I use App.js as my entry file not index.js
and genkey, set it in some file
adb install release.apk
success install, but can't load release when i open it
i change entry file into index.js, i get the same error
Same issue. The .pb file is not loaded in release APK and hence error caught when using react-native-camera
following takePictureAsync
for tfImageRecognition
Are you following this guide to create the apk: https://facebook.github.io/react-native/docs/signed-apk-android.html ? I am asking because you should not need to require to do react-native bundle
yourself anymore as it is done when running gradlew assembleRelease
. Also, can you try to run react-native run-android --variant=release
and see if that works?
Followed the Signed APK guide along with react-native run-android --variant=release
. No success. The gradle is 3.0.1 if that matters at all
I have pushed a fix that might help - can you update to version 0.1.8
and see if that helps
Same issue with the release variant
Do check the repo: https://github.com/aryaminus/nazar where the react-native-tensorflow has been used for real time analysis
same issue here, any solutions?
place the graph.pf file in the assets folder
=> android/app/src/main/assets/graph.pb
now you can access it like this:
const tf = new Tensorflow('file://graph.pb');
it works for me. and yes, the file uri is correct file://something
according to this commit: https://github.com/reneweb/react-native-tensorflow/commit/5e3893082995f1a34ce542f575e1e3ef29695302
if(resource.startsWith("file://")) { return loadFromLocal(resource.substring(7));
I solve this problem by myself. The solution is in StackOverflow (in Brazilian Portuguese): https://pt.stackoverflow.com/questions/339929/erro-ao-implementar-o-tensorflow-em-react-native/341411#341411