react-native-unity-demo
react-native-unity-demo copied to clipboard
Error when run demo
When I run your demo on Emulator or Device I get the above error, please help me to solve it, thanks
It's quite hard to resolve dependencies. Alternative solution is bundling RN source code files in release mode then checking const
keyword in this file instead.
To do this thing, use this command at the RN root folder:
npx react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/src/main/assets/react/release/index.android.bundle --assets-dest ./android/app/src/main/res
Note that you should create android/app/src/main/assets/react/release
folder before execute this command.
I already check this for you so I certainly sure that this error no longer exist in bundling file. But you'll get another error. "That's how things works".
FYI, later versions of RN using assets/index.android.bundle
instead of assets/react/release/index.android.bundle
so you may need to change the path to bundle file if you consider upgrate RN version.
If you see an error about String resource 0x0, add these 2 lines of code to strings.xml and it'll work.
<string name="game_view_content_description">Game view</string>
<string name="unity_root">unity_root</string>
Or you can use my forked repo instead:
https://github.com/ThinhVu/react-native-unity-demo
Thank you, I will try it.