Failed to find target with hash string 🤖 Android

Failed to find target with hash string 'android-34' / Failed to install the following Android SDK packages as some licences have not been accepted

Gradle needs an SDK platform/build-tools that isn’t installed, or the licences haven’t been accepted on this machine.

Seen on: Android

Meaning

Gradle can auto-download missing SDK packages only after licences are accepted. CI images and new machines usually need sdkmanager --licenses.

Common causes

  • Platform (android-34) or build-tools not installed
  • Licences not accepted
  • SDK directory read-only (CI)

⚡ Quick fix

  1. Accept licences: sdkmanager --licenses
  2. Install the platform: sdkmanager "platforms;android-34"
  3. Make the SDK folder writable

Detailed fix by platform

Shell

  1. kotlin
    yes | sdkmanager --licenses
    sdkmanager "platforms;android-34" "build-tools;34.0.0"

How to diagnose

  1. Installed — sdkmanager --list_installed
  2. Licences — $ANDROID_HOME/licenses folder

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.