Closed ShaubertIlya closed 5 years ago
You need to link the unity-classes.jar
.
Therefore do the following steps:
unity-classes.jar
(usually should be located under /android/UnityExport/libs/
)Another way would be to add this change in the gradle file.
@papsti7 I don't work in Android Studio. I've added this two strings
compile project(':UnityExport') compile fileTree(dir: '../../../android/UnityExport/libs', include: ['*.jar'])
into my android/app/build.gradle file, but it still doesn't work. I still get this issue about UnityPlayer. Can i do it just with react-native in Visual Code?
@ShaubertIlya I didn't test the solution from the link, but I thought it solves the same issue.
Nevertheless, you need to link the export in react-native-unity-view
project, which comes with npm, and not in the demo project directly.
node_modules/react-native-unity-view/android/
build.gradle
implementation files('XXX/UnityExport/libs/unity-classes.jar')
, where XXX is the path to the UnityExport
folder, to the dependencies
In my case, it's the absolute path, like implementation files('/Users/stefan/Documents/Programming/react-native-unity/react-native-unity-demo/android/UnityExport/libs/unity-classes.jar')
Let me know if this works.
@ShaubertIlya I didn't test the solution from the link, but I thought it solves the same issue.
Nevertheless, you need to link the export in
react-native-unity-view
project, which comes with npm, and not in the demo project directly.
- So navigate to
node_modules/react-native-unity-view/android/
- Open the
build.gradle
- Add
implementation files('XXX/UnityExport/libs/unity-classes.jar')
, where XXX is the path to theUnityExport
folder, to thedependencies
In my case, it's the absolute path, like
implementation files('/Users/stefan/Documents/Programming/react-native-unity/react-native-unity-demo/android/UnityExport/libs/unity-classes.jar')
Let me know if this works.
I did this and it doesn't work for me
@ShaubertIlya Make sure you clean the project before building again. Is it the same error or did something change? If it still doesn't wanna work, please install Android Studio and follow the steps from this comment.
It says that com.unity3d.player does not exist