Make sure your variables are in scope for the method that is referencing it. For example I had defined a textview locally in a method in the class and was referencing it in another method.
I moved the textview definition outside the method right below the class definition so the other method could access the definition, which resolved the problem.