Unable to Sync Emulator Screen with Local App Inventor on MS-Windows and Linux

Dear all,

I try to run the emulator with my local App Inventor. The emulator (aiStarter) started, but the emulator screen does not synchronize with the browser image. I try to run the emulator with the MIT server, it requested an update and then the screen synchronizes. But there is no update on my freshly-installed emulator with my locally-installed App Inventor server. Is there any clue how to fix this? The screenshot is attached. Thank you very much in advance.

Do you see any errors in the browser developer console or in the adb logcat?

Yes. It comes with a warning (or error?)

You are using an out-of-date Companion. You should update the
MIT AI2 Companion as soon as possible. If you have auto-update
setup in the store, the update will happen by itself shortly.

On the other hand, if I connect to the MIT App Inventor server, it asks for an update:

Your Companion App is out of date. Click "OK" to start the update.
Watch your emulator's screen because you will be asked to approve the update.

After the update, the app synchronizes correctly.

Is this AI companion version that caused the failure on the emulator?


If you’re looking to test the companion changes, you can just install it into the emulator using adb:

adb.exe uninstall edu.mit.appinventor.aicompanion3
adb.exe install build\\buildserver\\Emulator.apk

OK. It works after I reinstalled Emulator.apk manually. Thank you. :smile:
And what should our local teachers/students do next? Should I reinstall their Emulator.apk manually? Or is there any way that I can find out why the local server does not update the outdated Emulator.apk?

Handling the upgrading of the companion app in the old emulator is somewhat complicated. The version of companion packaged in that emulator image is quite old and it reads the upgrade bundle into memory. The challenge is that the companion is too large to fit into the heap space of the app now, so it crashes when you try to upgrade. Internally we have a tool called CompanionUpgradeHelper that we use in App Inventor to update the emulator without tripping on the memory issue, which is the process that is followed when you update via App Inventor. You may want to take the Appinventor-emulator-data file in your .appinventor folder and distribute that to people. Alternatively, you can try using the newer Windows emulator that we are beta testing, which has a newer companion. There’s a file called YaVersion.java where you can specify the acceptable versions, which you could set to the version of the companion bundled into that emulator.

OK. I see. Thank you for the answer. :heart: :slight_smile: