Nishanth Kr
Nishanth Kr

Reputation: 113

Failed to find target with hash string 'android-P'

I'm following this tutorial page

and i get the exact same error that they say in that page

Failed to find target with hash string 'android-P' in: D:\Development\Android\Sdk Install missing platform(s) and sync project

enter image description here

when i click

install missing platform(s) and sync project it shows the error as

enter image description here

All packages are not available for download! The following packages are not available:
- Package id platforms;android-P

enter image description here

enter image description here

I have installed almost all the SDK it asks for ANDROID - P.

Upvotes: 3

Views: 2300

Answers (3)

Geoffrey D.
Geoffrey D.

Reputation: 48

I followed the answer of Bevilaqua

Then, a dialog poped to make a Gradle Plugin Update : Android Gradle Plugin Update Required

Of course, it failed : enter image description here

So, to fix it, I manually installed a recent version of Gradle from enter link description here in my .gradle folder (in Windows C:\Users\...\.gradle\wrapper\dists\)

And I got another problem because a these line in styles.xml : <style name="Widget.Shrine.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlineBox"> where I replaced OutlineBox by OutlinedBox : <style name="Widget.Shrine.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox"> (Source)

Now, everything is functional.

Upvotes: 0

Bevilaqua
Bevilaqua

Reputation: 760

you're trying to find a SDK that corresponds to the version "android-p". Have a look at your build.gradle file: android { compileSDKVersion 'android-p' .......... }

change it to android { compileSDKVersion 28 .......... } note that the version 28 is just one example, you could be using any version.

that should do the job for you.

Upvotes: 4

Rod
Rod

Reputation: 1

It looks like issue is ralated to checksums in repositories. Take a look at this answear: https://stackoverflow.com/a/50842352

Upvotes: 0

Related Questions