- Home /
Project scripts stop working after building it in Android
Every time I change my build settings in Unity, from PC to Android, all of my project's scripts stop working. Why does this happen, and what do I have to do to get it to work in the Android build?
Does will always happens, because : Standalone ( PC,$$anonymous$$ac,Linux) is a different platform from android, therefore the scripts must be coded specificaly for the android. If you try exporting a multiplayer game to flash ( from Unity 4.0 flash beta ) it will give errors, because networking wasnt supported on flash then ( apparently ). same with mobile, some features from PC wont be on android, so you must coded it specificaly.
Answer by Melih Şimşek · Nov 01, 2013 at 12:38 PM
Because of lazytyping. Mobile devices does not support some codings like:
var class : ClassName = class.GetComponent(ClassName); // Wrong using
var class : ClassName = class.GetComponent<ClassName>(); // Instead of must be
While on StandAlone platform, try to use "#Pragma Strict" at the top of scripts.