OCR with GoogleOCR doesn't work


I can’t get the OCR to work using the Google API even though I copied the code exactly. How do I proceed, it’s been several times that I have the same problem.

This may be helpful for you:

But I have already followed this tutorial… and I have a problem

Then, download the aia file. It worked. (not in companion!)

GreenFridgeV3.aia.zip (3.2 MB)
Did it work for you ?

As indicated by @LVC_App_Center the demo aia file provided for AppInventor in the guide does work.

The correct setup of the google apps script is vital for this to work. You need to tell when it does not work for you on Kodular, and show your relevant blocks, script, and confirm that you have published the web app correctly and that you are using the correct script url in your blocks. I have not tested in Kodular, but there is no reason for it not to work…

There are not photos in my google drive folder when I take a picture (I have selected “Drive API” in GoogleAPP Script")

Your blocks image is unreadable…

I have sent my .aia file but I can send in best quality if you want

Please do that :slight_smile:



(the 2 blocks at the end are not important)

You have your blocks in the wrong order after converting a the image to a base64 string:

My blocks

Your blocks (which will not send a web request if the string was created)

Fix that, and then see if it works

It didn’t change anything, I don’t even have any pictures in the google drive folder I created.

You should be getting a response back from the script, what is it ?

Note: the uploaded images will be deleted by the script…

In label 20: I just have the location of the file of the photo taken. But I don’t have the notifier that starts

OK, sounds like we are not even getting to the script!

You may need to take your blocks apart (to stop it automating), and use Do it to check the values of each element (base64 string / mimetype / filename) as they are generated and put together in the PostText. Check each stage of the workflow, and ensure that everything is correct before sending the command to the web component.

Can you explain me in details what I have to do because I dont see “Do It”

Connect your project to the companion
Perform an action, then right click on a block and select Do it
It should return the value of the component

A simple example


Then run Do it on Label1.Text


(Things may look different in Kodular)