Android Error: Trying to update non-existent view with tag

I get an error on android (but not on iOS) when I toggle between buttons that make different containers visible.

Button logic:

Container 1: Is visible when pageVar “modeActions”=true
Container 2: Is visible when pageVar “modeActions”=false

Usually the first couple view changes work but then suddenly the error “Trying to update non-existent view with tag” appears.

Does anyone know a fix or workaround for this issue?

Thanks in advance!