can't resolve AppCompatActivity

后端 未结 30 1700
星月不相逢
星月不相逢 2020-12-04 17:43

After renaming application package name, Android Studio displayed this error can\'t resolve symbol AppCompatActivity

Things I tried: <

相关标签:
30条回答
  • 2020-12-04 18:13

    In Android Studio 3.1.2, I have the same issue After renaming application package name. The following worked for me:

    Deleting the ".idea" folder, Then File -> Invalidate Caches/Restart.

    0 讨论(0)
  • 2020-12-04 18:13

    I've updated appcompat library from version 25.0.1 to 25.1.0

    In gradle:

    from: com.android.support:appcompat-v7:25.0.1
    
    to: com.android.support:appcompat-v7:25.1.0
    

    Everything works well now.

    0 讨论(0)
  • 2020-12-04 18:14

    If all attempts failed (invalidate cache, clean and rebuild, restart,...), close Android Studio (maybe just close the project), run any file manager, go to project folder, find .idea/libraries folder and delete its content (list of xml files). After new start AS or opening project the problem should be resolved.

    0 讨论(0)
  • 2020-12-04 18:15

    head over to build.gradle(module app)

    if you hover your mouse over to com.android.support:appcompat a popup will say new version is available just replace in the existing version number with the new version number press sync now and you are good to go p.s nothing else worked for me on 2 pc's

    0 讨论(0)
  • 2020-12-04 18:16

    For me was enough to go on: - Tools > ANDROID > SYNC PROJECT WITH GRADLE FILES

    0 讨论(0)
  • 2020-12-04 18:18

    I've noticed that Android Studio 3.1 doesn't pull in the support libraries seamlessly. Here's how to trigger it. Update the support library version to 27.x.x newer version (you can get the new version info by mouse hover over the version number next to implementation under dependencies ) manually in the module's build.gradle file under dependencies. Then re-sync the project. Find the Visual Solution(Image) from this Link

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