1

I was refactoring a button name and accidentally put a space instead of underscore between two words (ex: "camera button" instead of "camera_button") and pressed enter. Almost immediately changed it to what it supposed to be, with underscore. Despite that I'm still getting Error:(4256, 39) error: ';' expected in my R file. I've tried editing the name in R file, cleaning, rebuilding the project, invalidating cache and even deleting all files from "generated" folder, but nothing works. Do you know what the problem can be?

Line on which the problem occurs:

public static final int camera button=0x7f1000e8;

and the error message:

Error:(4256, 39) error: ';' expected
Error:(4256, 46) error: <identifier> expected
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

0

Finally after many hours of fighting this problem I've found the answer. I've tried: deleting whole project and reimporting it from github, didn't work. I've tried every suggestion posted in the comments, didn't work. Completely uninstalling Android Studio an installing it again, nothing. Finally after researching about "aapt" and finding out it's a part of Android SDK and didn't got uninstalled during the uninstallation process I've uninstalled every single SDK in Android Studio and installed them again. I've rebuild the project and it worked! If you've encountered this problem I feel very sorry for you. I hope this answer helps!