Search code examples
macosandroid-manifestandroid-studio-2.1

Sources for Android API 24 Platform not found (Android Studio 2.1)


In Android Studio 2.1 I was using API 24 just fine, then suddenly started seeing "Sources for Android API 24 Platform not found" warning in my AndroidManifest.xml.

Rerunning the Android SDK Manager setup in Android Studio, removing other non-supported APIs, etc didn't work for me. How do I fix this?


Solution

  • After searching I found answers that were close enough to get me to my own answer for API 24. For me it was simply a matter of removing API 24, closing Android Studio, and (after reopening) letting Android Studio detect API 24 was missing and download it for me. I assume this would also work for other API versions.

    UPDATE: As others have pointed out, API 24 did not have "Sources" listed in SDK Manager at the time this question was asked/answered. However, everything was working fine before and continues to work after following this answer. So that seems to be a bit of a technicality worth mentioning.

    I have the app targeting and compiling for API 24 and on Google Play in Alpha testing.

    Android N APIs are now final (as of 15 June 2016).

    enter image description here

    Steps (Mac):

    1. Open SDK Manager: Tools > Android > SDK Manager
    2. Remove API 24: Deselect Checkbox > Click OK, OK again to confirm removal
    3. Quit Android Studio (⌘Q)
    4. Reopen your project in Android Studio
    5. Install missing platform(s) and sync project
      • Click this clickable link in the Messages Gradle Sync panel enter image description here

    Once the Gradle Sync finishes that should take care of it.