- Home /
Problem when excluding a class for cross-platform build.
I'm getting the following error when trying to make a pc build: The name 'AndroidMultiplayerManager' does not exist in the current context.
The call to a method CreateQuickGame() which is in this class looks like this:
...
else if ((GameData.currentMode == GameMode.Multiplayer)) {
Instantiate (map1Prefab);
#if UNITY_ANDROID
AndroidMultiplayerManager.CreateQuickGame();//This causes Error
#endif
}
I have set the target platform to PC, how can I get rid of this error?
That should work according to the documentation. What happens if you add #define UNITY_ANDROID at the top of that file? If that works then it seems like it might be some sort of bug. What version of Unity?
You can also set up custom Platform defines in settings. Scroll down to "platform custom #defines", or global defines. If it is a bug you should be able to work around it that way.
Actually removing that line helped, after deleting it everything works.
Answer by ilmix123 · Apr 04, 2017 at 07:15 PM
I found the problem, I didn't notice the line`#define UNITY_ANDROID` at the beginning of the script. After removing it the error is gone.