Operation Steps
Open File–>project Structure
Select the current item and click the Denpendencies tab
Click +, select Library dependency
Open the interface as follows:
Enter the desired dependent library part character, such as design, then click on the Search icon on the right
The search results are as follows:
Note
This method searches for the most recent version of the dependent library and may be higher than the current project's compiled version.
Therefore, you should modify the version number of the appcompat-v7 that was added automatically when the project was created "for Recyclerview, CardView, and design" by adding the dependent library version number.
References
Android-android Studio searches the latest version of the dependent library online
Android Studio: The version number of the dependent package
Androidstudio Online Search for the latest version of the dependent library