简体   繁体   中英

Errors in R.java (android studio) after compilation

I am new to Android Studio and with the new version, I am facing some serious issues. Every time I try to compile any android package , I get the following errors:

These errors are indicated in R.java - which is not supposed to be edited externally.

Error:(1452, 32) error: <identifier> expected
Error:(1452, 34) error: illegal start of type
Error:(1452, 35) error: <identifier> expected
Error:(1453, 32) error: <identifier> expected
Error:(1453, 34) error: illegal start of type
Error:(1453, 35) error: <identifier> expected
Error:(1454, 32) error: <identifier> expected
Error:(1454, 34) error: illegal start of type
Error:(1454, 35) error: <identifier> expected
Error:(1455, 32) error: <identifier> expected
Error:(1455, 34) error: illegal start of type
Error:(1455, 35) error: <identifier> expected
Error:(1456, 32) error: <identifier> expected
Error:(1456, 34) error: illegal start of type
Error:(1456, 35) error: <identifier> expected
Error:(1457, 32) error: <identifier> expected
Error:(1457, 34) error: illegal start of type
Error:(1457, 35) error: <identifier> expected
Error:(1458, 32) error: <identifier> expected
Error:(1458, 34) error: illegal start of type
Error:(1458, 35) error: <identifier> expected
Error:(1459, 32) error: <identifier> expected
Error:(1459, 34) error: illegal start of type
Error:(1459, 35) error: <identifier> expected
Error:Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

Please let me know a possible solution. Earlier, I was facing an encoding incompatibility error , which I fixed and then dropped to this problem.

In my case, I deleted the lines and files which caused error (at XML files and drawabale). Then, I clicked on Build-Clean. It works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM