f111fei/react-native-unity-view

com.unity3d.player does not exist

Closed this issue · 4 comments

I've installed react-native-unity-view as it mentioned in the instruction and exported Unity project.
I clone react-native-unity-demo project and paste my unity project. It gives me an error related to unity3dplayer.

What can be wrong?

react-native-cli: 2.0.1
react-native: 0.57.1
react-native-unity-view: ^1.1.5,
react-native-firebase: ^5.0.0,
Unity engine version: 2018.2.14f1

Task :react-native-unity-view:compileDebugJavaWithJavac FAILED
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityUtils.java:10: error: package com.unity3d.player does not exist
import com.unity3d.player.UnityPlayer;
^
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityUtils.java:21: error: cannot find symbol
private static UnityPlayer unityPlayer;
^
symbol: class UnityPlayer
location: class UnityUtils
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityUtils.java:26: error: cannot find symbol
public static UnityPlayer getPlayer() {
^
symbol: class UnityPlayer
location: class UnityUtils
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityView.java:11: error: package com.unity3d.player does not exist
import com.unity3d.player.UnityPlayer;
^
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityView.java:19: error: cannot find symbol
private UnityPlayer view;
^
symbol: class UnityPlayer
location: class UnityView
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityView.java:21: error: cannot find symbol
protected UnityView(Context context, UnityPlayer view) {
^
symbol: class UnityPlayer
location: class UnityView
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityViewManager.java:12: error: package com.unity3d.player does not exist
import com.unity3d.player.UnityPlayer;
^
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityUtils.java:49: error: cannot find symbol
unityPlayer = new UnityPlayer(activity);
^
symbol: class UnityPlayer
Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityUtils.java:73: error: cannot find symbol
UnityPlayer.UnitySendMessage(gameObject, methodName, message);
^
symbol: variable UnityPlayer
location: class UnityUtils
Note: Q:\LocalRepo\react-native-unity-demo-master\node_modules\react-native-unity-view\android\src\main\java\com\reactnative\unity\view\UnityViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors

Probably same as this #25
@f111fei What do you think?

Is it stable way to solve ussue?

Probably same as this #25
@f111fei What do you think?

Probably the same issue as well