“Default Activity Not Found” on Android Studio upgrade

后端 未结 30 1991
时光说笑
时光说笑 2020-11-22 05:08

I upgraded IntelliJ Idea from 12.0.4 to 12.10.

Now all the modules in my Android project give the error:

Error: Default Activity Not Found

30条回答
  •  后悔当初
    2020-11-22 06:07

    In my case File -> Invalidate Caches / Restart... didn't help

    Everything was ok with my project and of course I had next intent filter for my activity

    
        
        
    
    

    What really helped me is deleting Android/Gradle cache folders (they can grow up to 10-30 GB)

    Go to C:\Users\YOUR_USER_WINDOWS_NAMEand delete next folders

    • .android
    • .AndroidStudio3.2
    • .gradle

    (you may save some Android configs from .AndroidStudio3.2 before deleting it if you want it)

    You can create bat file CLEAR_CACHE.cmd like this to delete folders without Recycle Bin

    rmdir /S /Q .android
    rmdir /S /Q .AndroidStudio3.2
    rmdir /S /Q .gradle
    

    it would work much faster and you don't have to delete it also from Recycle Bin

    p.s. put CLEAR_CACHE.cmd into C:\Users\YOUR_USER_WINDOWS_NAME

    it's also a good idea to delete Android Studio folder and download it again

提交回复
热议问题