How to use Microbit to print message in app

I am trying to get microbit to print a message on the screen when it recognizes an object with the huskylens. My code worked about two months ago, but now, it doesn't appear to work because when the microbit connects, the app companion on my phone crashes.
Here is a picture of my code: