-1

I am working on an app, But recently one of my Java file showing some unknown characters I also tried changing the encoding of a file but it not working, Is there any way that I can help me to get the file back?

screenshot of the problem I am facing now ...

enter image description here

expect that one file remaining all files are fine

Error Report

error: class, interface, or enum expected   
error: illegal character: '\u2649'  
error: illegal character: '\ufffd'  
error: illegal character: '\u16f6'  
error: illegal character: '\u1a5c'  
error: illegal character: '\uec94'  
error: illegal character: '\u202f'  
error: illegal character: '\u0f0c'  
error: illegal character: '\uf85f'  
error: illegal character: '\ufffd'  
error: illegal character: '\ufffd'  
error: illegal character: '\u2e0a'  
error: illegal character: '\u2976'  
error: illegal character: '\u2b69'  
error: illegal character: '\u33d4'  
error: illegal character: '\u24ed'  
error: illegal character: '\u1ca5'  
error: illegal character: '\u2938'  
error: illegal character: '\ufffd'  
error: illegal character: '\ufffd'  
error: illegal character: '\ufffd'  
error: illegal character: '\u4de6'  

Thanks for help

DKV
  • 1,767
  • 3
  • 28
  • 49
AgentP
  • 6,261
  • 2
  • 31
  • 52

4 Answers4

0

When files show random characters like that it usually means there was an error in the compression or convertion of the file. For example, if you take a Word document and open it in Notepad you'll see something similar to that. If you have a backup or another copy I'd recommend trying that version.

Ryan Russell
  • 739
  • 1
  • 8
  • 21
0

first try to Invalid Cashes/Restart Android Studio, if not resolved then try below way

click here

Mayur Dabhi
  • 3,607
  • 2
  • 14
  • 25
  • I tried Invalid Crashes but it not worked and The Second method is uninstalling and reinstalling android studio I am afraid that will also not work because when i open the file in notepad++ the code is still in unknown format – AgentP Dec 17 '18 at 06:39
  • if you delete .idea, .dradle, build file and import again then may be you get original code – Mayur Dabhi Dec 17 '18 at 06:55
0

The simple and the easy way. Go to your folder location the app>src>main>java>com> In general open your folder when you store your project then try to open the file with notepad or open code. You will find your code, copy it and delete your old file.java and past it in a new java file have the same name

0

first: create a backup of your project. than: you should delete android studio catch for this --> open C:\Users\plusg\AndroidStudio

for me : --> C:\Users\plusg\AppData\Local\Google\AndroidStudio2020.3

and just delete android studio catch. this folder not important just save android studio theme,font and etc.

now open your project again.