Error: Please select Android SDK solution (for reference only)

1. Problem description

        Today I started to formally contact the work content of the project, and then git cloned an Android Studio project from the code warehouse in the group. After downloading, I used Android Studio to open this project, but encountered many errors when trying to compile and run. For example, a small red cross ( × ) is marked on the app next to the small hammer used for compilation on the development environment interface , which means that it cannot be clicked to run anyway, and the real device cannot be selected.

        Then click File->Project Structure and the following Error will appear

Error: Please select Android SDK

        There is a solution on the Internet to uncheck the installed SDK Platform by editing the Android SDK. Detailed reference blog: https://blog.csdn.net/weixin_40611659/article/details/119323037 . As shown below:

        But I can only say that this solution is not suitable for me, because I can't uncheck it. So, I tried the following solutions through other sources.

Two, the solution

        The reference is: https://blog.csdn.net/u013346208/article/details/81163221 . This information shows that there is a line of key information of type="jdk" under the orderEntry tag in the app.iml file. This line of key information sets the Android SDK version used by the entire project. Then I checked the app.iml file in my project (Note: You can search for this file through file search, this is how I found it, and then it is in "XXX project name\.idea\modules\ app "Path below), I found that my project is based on Android API 29 Platform, because this line of information is as follows:

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

        Then I checked the SDK version I have installed:

        I found that there are quite a lot of installations, and it also includes Android 10.0 (Q), which is API Level=29. Then there should be no problem with the compilation, I am a little puzzled.

        Later, the unimportant SDKs were deleted, leaving only Android 10.0 and 7.0. Finally, compile it again, and it's done. hehe. It turns out that the more Android SDK installed, the better, as long as it is enough.

3. Summary

        1. The more Android SDK installed, the better, as long as it is enough.

        2. Since only 34, 33, and 32 appeared in the column of Android API names, I also went to Google to see why there were no 31, 30, and 29, haha.

        Then I read a piece of information on StackOverFlow: I need Android API 30 But cannot see that API in the SDK platform list . This information shows that Android 12.0 (S) is Android API 32, Android 11.0 (R) is Android API 31, and Android 10.0 (Q) is Android API 30,,, and so on.

        3. When encountering problems, you need to think more. Don’t search for your own problems directly. If you can’t find the answer or can’t solve it, you will find it difficult. You can write a few plans on paper, and then go to implement them.

        4. If you have any questions, please leave a message!

4. Reference

        1. Error: Please select Android SDK_Feng Xu_Android's Blog-CSDN Blog

        2. Android Error: Please select Android SDK problem collection

        3、I need to install Android API 30. But I cannot see that API in the SDK platform list

Guess you like

Origin blog.csdn.net/qq_36158230/article/details/131940269