build-android-binary

Compiles Android Kotlin modules into runtime-loadable DEX binaries for .ppmplugin packages.

808|167|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/microsoft/power-platform-skills --skill build-android-binary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-android-binary
Source: https://github.com/microsoft/power-platform-skills/tree/main/plugins/power-apps-mobile-extension/skills/build-android-binary
Command: npx skills add https://github.com/microsoft/power-platform-skills --skill build-android-binary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building a Power Apps Mobile extension's Android Kotlin module into a DEX binary that the wrap runtime can load via DexClassLoader requires a correctly configured standalone Gradle build, pinned toolchain versions, and strict manifest alignment — a process that is error-prone when done manually.

Core Features & Use Cases

  • Staged Standalone Build: Copies the canonical android/ source into a throwaway staging directory, pins the React Native react-android dependency, compileSdk 35, and a checksum-verified Gradle 8.13 wrapper, leaving the original source untouched.
  • Runtime Constraint Validation: Verifies DexClassLoader constraints before building — no @ReactModule annotations, a public no-arg ReactPackage constructor, correct getName() and package FQN matching manifest.json, and no SDK-era symbols.
  • AAR-to-DEX Compilation: Runs gradlew assembleRelease, extracts classes.jar, and invokes d8 --min-api 24 (resolved by absolute path from the Android SDK) to produce ppmplugin/staging/android/<Pascal>Plugin.dex, with optional JNI .so extraction.
  • Use Case: After generating a .ppmplugin manifest for a Power Apps Mobile control, run this skill to produce the Android binary, then hand off to /assemble-ppmplugin to zip the final bundle.

Quick Start

Build the Android DEX binary for my PAM control from the staged manifest and Kotlin source.

Frequently Asked Questions about build-android-binary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an Android DEX binary for a Power Apps Mobile plugin?

Run this skill after generating the ppmplugin manifest. It stages a standalone Gradle build of your Kotlin module, runs assembleRelease to produce an AAR, then compiles classes.jar to DEX with d8 --min-api 24, writing the result to ppmplugin/staging/android/.

What tools are required to compile Kotlin to DEX with d8?

You need JDK 17 or later and Android SDK Build-Tools 35.0.0 containing d8, plus the android-35 platform. The skill locates d8 by absolute path from the SDK even when it is not on PATH, and a system Gradle is only needed to bootstrap the pinned wrapper.

Does this Android build work on Windows or only macOS?

The Android build is fully cross-platform and runs on macOS, Linux, and Windows, since JDK 17, Gradle, and the Android SDK d8 tool exist on all three. Every shell command is provided in both bash and PowerShell forms.

Why does the Gradle build fail with compileSdk or React resolution errors?

Standalone builds lack the managed host's rootProject.ext values, so compileSdk may fall back below 35, which AGP rejects when compiling against RN 0.79's react-android AAR. The staging copy pins compileSdk 35 and the com.facebook.react:react-android compileOnly coordinate to fix this.

Why does my plugin fail to load at runtime with 'Loaded 0 plugin package(s)'?

This happens when the ReactPackage class lacks a public no-arg constructor, since the wrap runtime instantiates it via getDeclaredConstructor().newInstance(). The skill checks for this before building and blocks with a clear error if the constructor takes parameters.

When should I not use this skill in the ppmplugin workflow?

Do not use it to author manifest.json (run /generate-ppmplugin-manifest first), to zip the final .ppmplugin bundle (use /assemble-ppmplugin), or to build iOS binaries, which require the separate Mac-only /build-ios-binary skill.