Our project can be build to iOS Android platform, everything is normal. But today when we tried to Build for Web (Switch platform > Web player), a number of complication error showed up…
Here are some:
Assets/Scripts/CheckVer.cs(152,1): error CS8025: Parsing error
Assets/Scripts/Friend.cs(513,14): error CS0116: A namespace can only contain types and namespace declarations
Assets/Scripts/Friend.cs(533,14): error CS0116: A namespace can only contain types and namespace declarations
Does anyone know the reason, or any method to solve this?
Maybe try sharing the code you have which doesn’t compile. The compiler is telling you the files and the lines with the problems. I doubt anyone here can guess what the problems are without seeing the code.
The Corresponding compilation error to this file is:
Assets / Scripts / CheckVer.cs (117,10): error CS0116: A namespace can only contain types and namespace declarations
Assets/Scripts/CheckVer.cs(152,1): error CS8025: Parsing error
This file is the same as the others, everything is fine with iOS Android. It only happens when build to “Flash” or “Web player”…
First of all, as MonoDevelop seems to recognize here, the closing bracket for the Update is missing. Monodevelop highlights my Update opening bracket if i select the last bracket in the code. So your code seems to be messed up because of your IF Statements for the platforms. You should double check your code for closing brackets which should also be commented out for other platforms. Check line 113, there is the } bracket but it belongs to this code which is greyed out for webplayer and flash: