Fix error handling in android clear