Error “package android.support.v7.app does not exist”

前端 未结 16 1779
-上瘾入骨i
-上瘾入骨i 2020-11-30 02:03

I am new to android development, and I have been using the command line tools to create an android project. I followed all the instructions given in the tutorial at android

16条回答
  •  我在风中等你
    2020-11-30 02:15

    I just got this error today and this is how I fixed.

    • On my build output, I double click on the class with the error.
    • After the class opened, I expanded the imports section and deleted existing imports with errors.
    • I then hovered my mouse near the errors which were:RecyclerView,LinearLayoutManager, and FragmentTransaction and chose Alt+Enter to import appropriate classes.

    Note: in my case, the error occured after I migrated one of my old projects to androidx and so imports hard to be androidx related. I am using android studio.

    Note: You may run into other issues, so everytime I run into an error, I check other called classes and makes sure their imports are correct. What I do mostly is press ctrl+shift+R, and put the old import in the first field and the correct import on the second field and then replace all. This way, I replace all imports that in the project at once.

    You can use ctrl+shift+f to find where imports are used.

提交回复
热议问题