Error: failed to find target with hash string 'android-21'

后端 未结 6 1715
自闭症患者
自闭症患者 2021-02-13 21:03

I want to change my compileSdkVersion from 23 to 21.So I have made following changes in the build.gradle but I am getting following error.How can I resolve this?

6条回答
  •  情深已故
    2021-02-13 21:24

    Note: I think this might be a bug in Android Studio.


    1. Go to Project Structure
    2. Select App Module
    3. Under the first tab "Properties" change the Compile SDK Version to API XX from Google API xx (e.g. API 23 instead of Google API 23)
    4. Press OK
    5. Wait for the completion of on going process, in my case I did not get an error at this point.
    6. Now revert Compiled Sdk Version back to Google API xx.

    If this not work, then:

    1. With Google API (Google API xx instead of API xx), lower the build tool version (e.g. Google API 23 and build tool version 23.0.1)
    2. Press Ok and wait for completion of on going process
    3. Revert back your build tool version to what it was before you changed
    4. Press Ok and Wait for the completion of process.
    5. Done!

提交回复
热议问题