NullReference in Start() or Awake() when testing on Android device, works fine in Editor

i’m getting a weird null reference exception when i debug my app on device (Asus Transformer Prime).

This happens in app initialization, both in Start() and Awake().
The Transform is being assigned in the Inspector, and when launching the app in the Editor it works fine, i get a reference to the Transform as expected, while on the device i get a null reference.

public Transform weirdObject;

void Awake()
{
    if(this.weirdObject == null) Debug.Log("meh. null.");
    else Debug.Log("yea it's not null");
}

Hi,
It’s a topic from long past but I had the same problem and I found solution for it in my case. I used SQLite and I added one table to database. When I copied .db file from Assets to StreaminAssets directory it still didn’t work. The solution for it was changing version of build in Edit>Project Settings>Player from 1.0 to 1.1. I don’t know why but it works.

I had this exact problem and I couldn’t find an answer. The NullReferenceException happened only on Android and iOS, while it was working fine on the editor. The script wasn’t even able to find anything using GameObject.Find(). It happened only in one of the objects in the scene, so my “dirt” solution was to create an empty gameobject with a singleton script linked to all the needed references, and use it as a “helper” of my problematic gameobject.

I think that this is some kind of strange bug of unity.