android-thingsandroid-things-console

Android Things custom image doesn't contain bundled APKs


I'm trying to flash the NXP i.MX7D with a simple custom image which has the default boot animation and a simple launcher. For whatever reason, after flashing, the default Android Things launcher is always launched and when I query for installed packages, my custom launcher is missing in the list.

My bundle:

bundle
├── bootanimation.zip
└── main.apk

I'm simply zipping this folder and uploading it to the console.

Launcher intent filter:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.IOT_LAUNCHER"/>
    <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

What I've tried so far:

  1. As per this SO question this can happen if the boot animation is not correctly created, so I tried with the one from the default Android Things image

  2. Deleted and re-created a product and tried again as per this

  3. Tried with both debug and release APKs for the launcher

  4. Tried flashing the image both directly and via an OTA on an empty build

Any ideas?


Solution

  • If bundle is actually a top-level directory inside of your archive, then the problem is that the archive format is incorrect. The artifacts that you wrap up into the console bundle must be files at the top-level (not nested in subdirectories).

    Here is an example of a command you could run to package the bundle archive properly for the single APK and boot animation.

    $ zip -r bundle.zip main.apk bootanimation.zip