Failed to find Platform SDK with path: platforms;android-P

前端 未结 4 856
孤城傲影
孤城傲影 2021-01-11 11:24

Error:FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project \':app\'.

Failed to find P

相关标签:
4条回答
  • 2021-01-11 11:30

    To fully test your app's compatibility with Android P and begin using new APIs, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion as shown here:

    android {
        compileSdkVersion 28
    
        defaultConfig {
            targetSdkVersion 28
        }
        ...
    }
    

    Set Up the Android P SDK

    0 讨论(0)
  • 2021-01-11 11:37

    Step 1: Open Preferences or Settings in Android studio. Select Android SDK options and Install Android API 28 as selected below.

    Step 2: There's a problem with compileSdkVersion as you have to change it from 'android-P' to 28.

    compileSdkVersion 28
    

    And Build project. That's it.

    0 讨论(0)
  • 2021-01-11 11:49

    Problem: Failed to find Platform SDK with path: platforms;android-27

    Solution:

    • Just change compileSdkVersion to 30, and targetSdkVersion to 30 and click on sync. The system will download some files and done. (you want an internet connection for this)
    android {
     compileSdkVersion 30
     defaultConfig {
           targetSdkVersion 30
     }
     ...
    }
    
    0 讨论(0)
  • 2021-01-11 11:50

    Failed to find Platform SDK with path: platforms;android-R

    put this code in android/build.gradle at the end

    0 讨论(0)
提交回复
热议问题