Skip to content

Resolving "Failed to find Platform SDK with path: platforms;android-35"

Problem Statement

When updating your Android project to target Android 15 (API level 35) in Android Studio Koala (2024.1.1), you may encounter the build error: Failed to find Platform SDK with path: platforms;android-35. This error typically occurs for one of these reasons:

  1. API 35 SDK not installed: The Android SDK Platform for API 35 isn't installed on your development machine
  2. Beta platform instability: Android 15 SDK was in beta phase at the time of initial release, leading to compatibility issues
  3. Gradle version mismatch: Your project's Gradle plugin or Gradle wrapper version is incompatible with API 35
  4. Missing preview configuration: Android 15 requires special configuration when working with beta/preview SDKs

This error commonly appears after updating your build.gradle file to target API level 35:

kotlin
android {
    namespace = "com.example.myprj"
    compileSdk = 35   // Problematic setting when SDK not installed
    
    defaultConfig {
        applicationId = "com.example.myprj"
        minSdk = 26
        targetSdk = 35  // Requires proper SDK configuration
    }
}

Solution 1: Install the Android 15 SDK Platform

IMPORTANT

This is the preferred solution if you require Android 15 features. Ensure you have Koala (2024.1.1) or later.

  1. Open Android Studio and navigate to Tools > SDK Manager
  2. Select the SDK Platforms tab
  3. Check Show Package Details in the bottom-right corner
  4. Under "Android 15", select:
    • Android SDK Platform 35
    • At least one system image (e.g., Google Play ARM64 v8a)
  5. Click Apply to install

Android SDK Manager showing API 35 selected

After installation, resync your Gradle project:

bash
# Resync Gradle projects in Android Studio
File > Sync Project with Gradle Files

STABILITY BEFORE FEATURES

Use this solution if you don't require Android 15-specific features. API 34 (Android 14) provides greater stability and compatibility with current libraries.

Modify your build.gradle.kts to target API level 34:

kotlin
android {
    namespace = "com.example.myprj"
    // Downgrade to stable API 34
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.myprj"
        minSdk = 26
        // Target stable API 34
        targetSdk = 34
    }
}

Additionally, update your dependencies to use stable versions compatible with API 34:

gradle
dependencies {
    // Use stable AndroidX libraries
    implementation("androidx.core:core-ktx:1.12.0")
    implementation("androidx.appcompat:appcompat:1.6.1")
}

Solution 3: Update Gradle and Plugin Versions

This solution addresses compatibility issues between the Android Gradle Plugin (AGP) and API level 35.

  1. Update project-level build.gradle.kts:
kotlin
plugins {
    id("com.android.application") version "8.5.0" apply false
    id("org.jetbrains.kotlin.android") version "1.9.20" apply false
    // Ensure other plugins also use recent versions
}
  1. Update Gradle wrapper version (gradle-wrapper.properties):
properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
  1. Resync and rebuild your project

Solution 4: Future Preview Configuration (For Beta SDKs)

BETA FEATURE

Only use this approach when working with preview SDK versions. For Android 15 stable releases, use compileSdk and targetSdk normally.

When Android releases are in preview phase (like Android 15 initially was), use preview-specific configuration:

kotlin
android {
    // Preview configuration syntax
    compileSdkPreview = "VanillaIceCream"
    
    defaultConfig {
        targetSdkPreview = "VanillaIceCream"
    }
}

Key Explanations

Why Reverting to API 34 Works

  • Stability: Android 15 was in beta when first released (through August 2024), leading to incomplete SDK packages
  • Library compatibility: Many libraries (like androidx.core) don't immediately support new platform versions
  • Release cycle: New Android versions undergo stabilization periods with SDK packages released in phases

Preventing SDK Path Errors

  1. Verify SDK installation: Always check SDK Manager after updating compileSdk
  2. Update Android Studio regularly: Each release contains bug fixes for SDK management
  3. Consistent versioning: Ensure all Android tools are updated simultaneously:

Additional Considerations

Final Recommendations

For most production applications, Solution 2 (reverting to API 34) provides the most reliable path. Only target Android 15 (API 35) when:

  1. All project dependencies explicitly support it
  2. You require specific Android 15 features
  3. SDK Platform 35 shows as installed in Android Studio
  4. Your team can dedicate resources to compatibility testing

After the stable Android 15 release (post-August 2024), revisit targeting API 35 using the installation procedure in Solution 1 combined with the build tool updates from Solution 3.