27

Installed Android 4.1 on Ubuntu 20.04. Getting the following error:

Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found.

On opening the SDK manager I get the following screen: android studio screenshot

I also executed $ANDROID_HOME/cmdline-tools/tools/bin/sdkmanager --licenses

How to fix this?

------ edit ---------

This is what shows in the SDK Platforms tab. Unchecking the "Hide Obsolete Packages" doesn't change anything.

Sdk platforms

Pradeep Kumar Jha
  • 877
  • 4
  • 15
  • 30

3 Answers3

48

As the error is saying. Install the SDK Platform with API Level 29. YOu need to switch to the tab " SDK Platforms and install the right API Level:

enter image description here

-----------edit--------------

maybe you changed accidently your SDK location.

Mine is on C:\Users\elmo\AppData\Local\Android\Sdk

Pay attention: using it on windows.

Elmar B.
  • 750
  • 4
  • 14
  • Edited the original post with the output for "SDK Ploatforms" tab. How to get API Level 29? – Pradeep Kumar Jha Nov 05 '20 at 16:23
  • 2
    You can find SDK Platforms under File -> Settings -> Appearance & Behaviour -> System Settings (or use the search to find it) – MadMac Dec 03 '20 at 22:57
  • 1
    With newer versions of Android Studio SDK Manager has a button on the toolbar (way top right next to the magnifying glass, it's a grey cube with a blue arrow next to it). It just opens the location @MadMac explained above. When you select a package you don't have installed, you'll see a download arrow to the left of the checkbox, click that and acknowledge the download in the next popup and it'll download it for you. – DebauchMode Feb 02 '21 at 16:35
10

go to the "sdk platforms" you can find it by click on navigate->find anywhere than enter "sdk" than what you need is to find the api level you need (29 in your case) and check the box near it.

daniel
  • 559
  • 5
  • 6
7

Go to File -> Project Structure -> Modules(Properties Tab) -> Change the compile Sdk Version and Build Tools Version to the the latest version available at the time img

Shoaib Yousuf
  • 71
  • 1
  • 2