Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Android Kotlin Application GeneratorNew to Visual Studio Code? Get it now.
Android Kotlin Application Generator

Android Kotlin Application Generator

Lord Programmer

|
5 installs
| (0) | Free
Create standard Kotlin + Jetpack Compose Android projects and build Debug/Release APKs from VS Code, without opening Android Studio.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Android Kotlin Application Generator

Create a standard Android app (Kotlin + Jetpack Compose) and build Debug or Release APKs from VS Code, without opening Android Studio.

The extension drives the official tooling (Android SDK, Gradle wrapper, Android Gradle Plugin, keytool). Generated projects are ordinary Gradle projects that also open in Android Studio.

Commands

Command What it does
Android Kotlin: Create New Application Wizard: name → package → location → Compile / Minimum / Target SDK → generates the project.
Android Kotlin: Build Debug APK Runs gradlew :app:assembleDebug, streams output, and locates the APK.
Android Kotlin: Build Release APK Runs gradlew :app:assembleRelease with your signing key, and locates the APK.
Android Kotlin: Configure Release Signing Selects an existing keystore or creates a new one; credentials go to VS Code Secret Storage.

Build output appears in the Android Kotlin output channel. After a successful build, use Open Output Folder to reveal the APK in your file manager.

Prerequisites

  1. Android SDK with at least one SDK Platform of API 36 or newer, plus accepted licenses:
    sdkmanager "platforms;android-36" "build-tools;36.0.0" "platform-tools"
    sdkmanager --licenses
    
    Android Studio installs these too, but it isn't required.
  2. JDK 17 or newer, a full JDK that includes javac. A Java runtime (JRE) is not enough. On Fedora/RHEL install java-21-openjdk-devel; on Debian/Ubuntu install openjdk-21-jdk. The JDK bundled with Android Studio is detected automatically.
  3. Internet access on the first build, so Gradle can download itself and the dependencies.

How tools are found

Tool Search order
Android SDK androidKotlin.sdkPath setting → ANDROID_HOME → ANDROID_SDK_ROOT → OS default (~/Android/Sdk, ~/Library/Android/sdk, %LOCALAPPDATA%\Android\Sdk)
JDK androidKotlin.javaHome setting → JAVA_HOME → Android Studio's bundled JBR → java on PATH (resolved to its JDK) → system JDK folders

If a path is set explicitly in the settings and is invalid, the extension reports it as an error instead of silently using a different SDK or JDK.

Settings

Setting Description
androidKotlin.sdkPath Absolute path to the Android SDK.
androidKotlin.javaHome Absolute path to a JDK 17+.

Both settings are machine-scoped. A workspace's .vscode/settings.json can't override them, so an opened repository can't redirect the build to a different JDK or SDK.

Creating an application

The wizard asks for:

  • Application name: the label under the launcher icon. It must start with a letter and may contain letters, digits, spaces, - and _.
  • Package name: the application ID, for example com.example.myapp. It needs at least two segments. Each segment starts with a letter, contains only [A-Za-z0-9_], and isn't a Kotlin/Java keyword.
  • Location: a writable parent folder. The project goes into <location>/<AppName>. Existing folders are never overwritten, not even empty ones. If the folder exists, you can pick another name or location.
  • Compile SDK: the API your code is compiled against. Only installed, stable platforms are offered.
  • Minimum SDK: the oldest Android version that can install the app (API 23 or higher, as required by the AndroidX libraries).
  • Target SDK: the version the app is designed for. It must be between Minimum SDK and Compile SDK.

The rule minSdk ≤ targetSdk ≤ compileSdk is enforced, and so is a platform-must-be-installed check. Library versions are picked to match the Compile SDK:

Compile SDK Compose BOM core-ktx activity-compose lifecycle
37+ 2026.09.00 1.19.1 1.13.0 2.11.0
36 2026.06.01 1.18.0 1.12.4 2.10.0

Toolchain: Gradle 9.8.2 (the download is verified by SHA-256), Android Gradle Plugin 9.5.0 with built-in Kotlin, and the Kotlin Compose compiler plugin 2.4.21.

Generated layout

MyApplication/
├── app/
│   ├── build.gradle.kts
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/com/example/myapplication/
│       │   │   ├── MainActivity.kt
│       │   │   └── ui/theme/{Color,Theme,Type}.kt
│       │   └── res/ (strings, themes, adaptive launcher icon)
│       └── test/java/com/example/myapplication/ExampleUnitTest.kt
├── gradle/
│   ├── libs.versions.toml
│   └── wrapper/gradle-wrapper.{jar,properties}
├── build.gradle.kts
├── settings.gradle.kts
├── gradle.properties
├── local.properties   (sdk.dir, git-ignored)
├── Makefile           (make debug / make release / make clean)
├── gradlew
└── gradlew.bat

On Linux and macOS you can also build from a terminal with the generated Makefile:

make debug     # JAVA_HOME=${JAVA_HOME:-$HOME/android-studio/android-studio/jbr} ./gradlew assembleDebug
make release   # same, with assembleRelease
make clean

If JAVA_HOME isn't set, it falls back to Android Studio's bundled JDK. For a signed make release, set the ANDROID_RELEASE_* variables described in Release signing first. Without them the release APK is unsigned.

Building

Open the project's root folder (the one containing settings.gradle.kts) and run a build command. Before it runs Gradle, the extension checks that:

  • the workspace is trusted, because Gradle executes the project's build scripts;
  • settings.gradle.kts exists and includes an application module (com.android.application);
  • the Gradle wrapper is complete (gradlew, gradlew.bat, gradle-wrapper.jar, gradle-wrapper.properties) and downloads Gradle over HTTPS;
  • a suitable JDK and the Android SDK are available.

The extension runs ./gradlew on Linux and macOS (or sh gradlew if the script lost its executable bit) and gradlew.bat on Windows. Builds can be cancelled from the progress notification.

APK file names are never assumed. The extension scans app/build/outputs/apk/<buildType>/ (including product-flavor subfolders) and reads AGP's output-metadata.json.

Release signing

Run Android Kotlin: Configure Release Signing and choose one of these options:

  • Use an existing keystore: pick the .jks, .keystore or .p12 file, then enter the key alias, keystore password and key password.
  • Create a new keystore: generates a PKCS12 keystore with an RSA 2048 key valid for about 27 years. Save it outside the project and back it up: if you lose the keystore or its password, you can't publish updates.

The credentials are checked with keytool before they're saved. A wrong keystore password, wrong key password or a missing alias each gets its own error.

Where credentials live

Data Stored in
Keystore and key passwords VS Code Secret Storage (OS keychain), never in settings or files
Keystore path and key alias The extension's private global state (outside the project)
The Android project Nothing: no paths, aliases or passwords

At build time the values reach Gradle only as environment variables of the Gradle process. They are never passed as command-line arguments, which other users on the machine could see in process listings. Passwords are also masked in the output channel. Generated projects read:

ANDROID_RELEASE_STORE_FILE, ANDROID_RELEASE_STORE_PASSWORD,
ANDROID_RELEASE_KEY_ALIAS, ANDROID_RELEASE_KEY_PASSWORD

CI systems can set the same variables. Projects not generated by this extension are signed through the Android Gradle Plugin's standard android.injected.signing.* properties, which are also passed through the environment. The generated .gitignore excludes *.jks, *.keystore and local.properties.

If signing isn't configured, Build Release APK asks whether to configure it or to build an unsigned APK on purpose. An unsigned result (app-release-unsigned.apk) is clearly reported as unsigned. It is never presented as a production build.

Troubleshooting

Problem Fix
Android SDK not found Set ANDROID_HOME or androidKotlin.sdkPath.
No compatible Android SDK Platform is installed sdkmanager "platforms;android-36" (or newer).
Only a Java runtime (JRE) was found Install a full JDK 17+ and/or set androidKotlin.javaHome.
licenses have not been accepted sdkmanager --licenses
Gradle wrapper is missing Restore the wrapper files, or run gradle wrapper in the project.
signing credentials were rejected Re-run Configure Release Signing.
A dependency requires a newer Compile SDK Raise compileSdk and install that platform.

Full Gradle output is always available in View → Output → Android Kotlin.

Development

npm install
npm run compile   # build to out/
npm test          # unit tests (node:test); no Android tooling needed
npm run package   # create a .vsix (requires @vscode/vsce)

Press F5 in VS Code to launch an Extension Development Host.

Architecture

src/
├── extension.ts              activation, command registration
├── commands/                 VS Code UI only (wizards, notifications, progress)
│   ├── common.ts             error handling, project picking, storage adapters
│   ├── createProject.ts
│   ├── buildApk.ts           Debug and Release builds
│   └── configureSigning.ts
├── android/                  SDK / JDK detection and API-level rules (no VS Code dependency)
├── project/                  input validation, template rendering, generation, project validation
├── build/                    Gradle invocation, APK location, signing and keytool
├── services/                 process execution (no shell), redacting logger
└── core/                     shared error type and signing environment names

Everything outside commands/ and extension.ts is independent of the VS Code API. External tools are accessed through the ProcessRunner interface, so tests can mock them.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft