Companion stuck after boot for Android Virtual Device (API31)

Issue:

  • The app gets stuck at a screen with the text "Running using the emulator or USB, waiting to get blocks..." upon opening the companion app right away.

image

Environment:

  • Android Virtual Device (Pixel 4 x64 system on API31 aka Android 12)
  • AI2 Companion Version 2.62

Steps to reproduce:

  1. Install AI2 Companion from Google Play Store
  2. Click on the App Icon to open it
  3. The screen pops up and the app is stuck at that stage.

Suspected relevant logs:
android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent

Background:

  • We are educators who wish to use App Inventor in our teaching. In order to test our own extensions, we need to run AI 2 Companion within Virtual Devices via Android Studio (buying a device for every single Android version is probably impractical)
1 Like

Since you're running the companion on a virtual device, it seems like the app thinks you're using an emulator, which is why it shows this text; this should be intended behavior for the emulator.

I do not have any ways to resolve this issue. You'll have to wait until someone else proposes a fix.

Thank you for your response.

I'll open a feature request on the support of testing apps within Android Studio then; it's hard to develop extensions that has decent current-day device support with the default emulator (Android 2.2!)

Here's the Companion and Emulator FAQ:

In case you have never used the AI2 Companion, be aware that connection needs to be initiated from the AI2 Project screen.

If you have the aiStarter package installed with the older emulator, you can use it with the newer emulator instance you're running. After starting the emulator in Android Studio, use the Connect > Emulator option to initiate the connection. aiStarter will use the running emulator rather than using the older one it embeds.

1 Like