All Activities and layouts got corrupted in Android Studio

前端 未结 6 1467
感情败类
感情败类 2021-02-02 10:03

I am working on a projects since 3 months. Today most of my activities and xml files got corrupted. I have tried deleting workspace.iml file but it remains same.Local History in

相关标签:
6条回答
  • 2021-02-02 10:26

    Erasing the cache of the Android studio will resolve the problem, for that you have to go to:

    C:\Users\user\.AndroidStudio3.5\system\caches
    

    (On windows)

    and on Mac:

    ~/.AndroidStudio3.5/system/caches
    

    Delete all the files there and restart the Android studio.

    0 讨论(0)
  • 2021-02-02 10:27

    Close android studio then delete the cache found in

    C:\Users\**user**\.AndroidStudio3.6\system\caches
    

    Important not to modify a file before having deleted the android studio cache

    If you modify a file you risk not being able to recover your old code

    0 讨论(0)
  • I also had the same problem this morning. I thought this was due to migrating to AndroidX but It was wrong. It may occur due to improper indexing and building for e.g. the indexing is force stopped. or due to some IDE issues.

    The isuue resolved by deleting gradle and .idea folder in project and clearing cache of Android Studio IDE by D:\Users\ABCD.AndroidStudio3.2\system\caches. And issue was resolved.

    Note:- Please take Project Backups Daily.

    0 讨论(0)
  • 2021-02-02 10:47

    Rename your project folder and delete .gradle and .idea file inside project folder

    0 讨论(0)
  • 2021-02-02 10:48

    I am also facing the same issue so i am copy the files from Project location which is corrupted. In my case, there is list of files corrupted due to module added in Login Activity

    1. build.gradle (Project)
    2. build.gradle (App-level)
    3. AndroidManifest.xml
    4. activity_login.xml
    5. ActivityLogin

    Steps to solve the problem

    1. I have deleting .iml and .idea file then restart the Android Studio.
    2. Paste the content from Project Location which is corrupted
    3. Commenting the code in which module classes available
    4. Run the application
    5. If you are using git then rollback the changes in corrupted files as copy-paste process as done in Step-2

    Above one process is working for me.

    0 讨论(0)
  • 2021-02-02 10:49

    I solved that by

    Close project you are working on

    //This enables deleting all cache files Close android studio

    navigate to .AndroidStudio folder and then sytem then cache

    delete the cache

    Go to your project folder delete delete gradle and .idea folder

    delete app.iml file too

    import project dont open as exixting.

    Boom you done.

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