Android Studio Corrupted .java file after improper shutdown

后端 未结 9 646
梦谈多话
梦谈多话 2020-12-30 05:01

I hibernated my laptop when Android Studio was running and found later that the laptop had been shut down. Now one of my source files is appearing empty in Android Studio an

相关标签:
9条回答
  • 2020-12-30 05:41

    Simple steps that always helped me to solve this problem

    Delete caches folder of the path

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

    Deleting above folder only sometimes will not work so, need to delete specific project's caches folder too

    F:\AndroidStudioProjects\sampleApplication\.idea\caches
    
    0 讨论(0)
  • 2020-12-30 05:44

    First: always use source control. Git and similar DVCS's don't require a server and can create a repository for you locally.

    As for recovering your file, whether it's practical will be a matter of whether the disk blocks pointed to by the filesystem are correct; the fact that you're seeing \0 suggests that you're using an SSD and that the filesystem records have the right size but wrong block(s), meaning that recovery is unlikely. You should open the file with a hex editor and see whether any content past the initial few bytes is readable. If not, the file itself is almost certainly unrecoverable.

    However, IntelliJ includes a local-history feature that may have an older copy of the file.

    0 讨论(0)
  • 2020-12-30 05:46

    Simplest Soultion !

    1. Open this website - http://www.javadecompilers.com
    2. Upload the APK file of your project(app-debug.apk)
    3. And here we go, you can see and download the whole project.

    Note: If you want your java files, than you can find them in the folder 'com' of the parent folder of the decompiled(downloaded) folder.

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