Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android SDK "Android API 29 Platform" is not found on the disk or corrupted #6908

Open
EvgeniiaVak opened this issue Sep 19, 2023 · 21 comments

Comments

@EvgeniiaVak
Copy link

EvgeniiaVak commented Sep 19, 2023

Steps to Reproduce

  1. create a new flutter project in android studio (I selected for android, ios and web)
  2. when opening main.dart observe this notification (appears by itself, when the project is just created)
    Screenshot 2023-09-19 at 21 30 58
  3. try to configure in Project Settings -> Project and -> Modules any sdk
  4. observe that android emulator vanishes from the top-right Flutter Device selection dropdown

To fix this I explicitly set up <no SDK> and the emulator appeared again in the dropdown, but the android sdk warning stays.

Version info

 % flutter doctor -v 
[✓] Flutter (Channel stable, 3.13.4, on macOS 13.4 22F66 darwin-arm64,
    locale en-AM)
    • Flutter version 3.13.4 on channel stable at
      /Users/evgeniia/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (7 days ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version
    34.0.0)
    • Android SDK at /Users/evgeniia/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/evgeniia/Library/Android/sdk
    • Java binary at: /Users/evgeniia/Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/evgeniia/Applications/Android
      Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.81.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] VS Code (version 1.83.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension can be installed from:
      🔨
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android
      14 (API 34) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS
      13.4 22F66 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google
      Chrome 117.0.5938.88

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@holocronweaver
Copy link

Also getting this error for the first time, but in my case it is API 32. Similarly cannot access emulators, or even physical devices, only the Linux target (my dev OS).

@philipmjohnson
Copy link

philipmjohnson commented Sep 28, 2023

Also getting this error. Just started happening two days ago. MacOS Ventura 13.2.

@petergloor
Copy link

Same Issue with API 29 on Linux.

@WrathOP
Copy link

WrathOP commented Oct 1, 2023

I am getting this error too on macos sonoma

@Decron
Copy link

Decron commented Oct 1, 2023

Same here. Macbook Pro 2022 / Ventura, just upgraded to Apple Sillicon from 2014 MPB. Also getting all-clear from flutter doctor

Edit: I was just able to make the banners disappear for 29 and 30 by uninstalling and reinstalling the following from Preferences/Languages & Frameworks/Android SDK. Errors disappeared after restarting Android Studio

  • Android 12.0 (API 31)
  • Android 11.0 (API 30)
  • Android 10.0 (API 29)
  • Android 9.0 (API 28)

Seems you need to install the APIs directly above and below the errant APIs for some reason.

Also fiddled with SDK in Platform Settings for awhile, not sure if that helped anything

@holocronweaver
Copy link

+1 to @Decron, simply uninstalling and reinstalling the Android SDK seems to resolve the issue.

However this is just a workaround - the SDK shouldn't have been marked as corrupted in the first place, so there is still a bug to fix in Android Studio.

@Vasilisk7
Copy link

Same problem
Wndows 11
android-studio-2022.3.1.18

@nguyengiabao0805
Copy link

nguyengiabao0805 commented Oct 8, 2023

image
I did it

@abd-koumare
Copy link

Thanks @nguyengiabao0805 it works !
File -> Project Structure -> SDKs then make sure SDK home path is correct and Android API Level match with Build target.

@Apollo108
Copy link

didn't help, I reinstalled SDK from the SDK manager, also didn't help. M2 Pro, MacOS Sonoma. Any other ideas?

@abd-koumare
Copy link

@Apollo108 follow this step File -> Project Structure -> SDKs then make sure SDK home path is correct and Android API Level match with Build target.

If it didn't works take a screenshot of File -> Project Structure -> SDKs

@omidshojaee
Copy link

Hello @abd-koumare

This is my screenshot. You can see the error message too. I have uninstalled and reinstalled API 29 already.
Android Studio Giraffe | 2022.3.1 Patch 2 Build #AI-223.8836.35.2231.10811636, built on September 15, 2023

Screenshot 2023-10-23 101032

@abd-koumare
Copy link

abd-koumare commented Oct 23, 2023

@omidshojaee Ensure that the Build target dropdown does not have Android API 29 Platform. If this API version is not available, you can obtain it by navigating to the SDK Manager (File -> Tools -> SDK Manager -> SDK Platform) and then update the build target to Android API 29 Platform accordingly.

@mgdu90
Copy link

mgdu90 commented Nov 22, 2023

Capture d'écran 2023-11-22 141521

Hi, @abd-koumare
I have the error. How can I add an new path ? I have already a path to Androif API 34

@abd-koumare
Copy link

You have selected the openjdk path instead of the Android SDK home path. Please verify that the correct path is either C:\Program Files\Android\sdk or C:\Users\Yourname\AppData\Local\Android\Sdk, and then ensure that you set the Android SDK home path. Additionally, adjust the Build target accordingly.

@pingbird
Copy link
Member

This is particularly annoying in my case because I do not use the android plugin, but the flutter plugin has a hard dependency on it. The warning at the top is not dismissible and there is no way to get rid of it without setting up Android and having it consume a ridiculous amount of memory, the whole reason I use IDEA instead of Android Studio to begin with.

@hayata-yamamoto
Copy link

I also faced the same issue.

@gcb
Copy link

gcb commented Oct 9, 2024

root cause for this annoyance is caused by whatever is creating the default/template for <project>/android/<project>_android.iml

It hardcodes the line

<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />

which is not based on any sensible actual value (e.g. minSDK would be 21, compile/targetSDK would be 35)

@gcb
Copy link

gcb commented Oct 9, 2024

@xster (based on flutter/flutter@a2e5e07) do you know what creates that template? should that file says <orderEntry type="inheritedJdk" /> instead?

@ViktorVoloshko
Copy link

Don't have this issue in AS but do in IDEA Ultimate.

How to fix:

  1. Open Project Structure.
    {3902A23F-1D80-4F2C-972F-E69D1DCEB3FF}
  2. On the right click Modules, select one that is ${project_name}_android.
    image
  3. Click on Android API 29 Platform and from drop-down select desired SDK.
    {DAFE4B54-E198-4F79-B9F5-376648BB68EE}
  4. Click Apply. It started indexing but was taking long so I restarted IDE after that and it disappeared.

@CoderMaximus
Copy link

CoderMaximus commented Jan 31, 2025

Every time i click on Download Android SDK when i click configure, it actually prompts me for JDK...?
EDIT: I created a new project and the error wasn't there. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests