When images are added to the Android project, the error cannot be resolved or is not a field is returned.

Source: Internet
Author: User

SDK and ADT are 22.6.2

Project 4.4.2

When I wrote the Android code today, I added several images to the project and used the R. drawable call in the Code. The error cannot be resolved or is not a field

Then I checked the R. in the java file, I found that the image resource id I added already exists. I think it is strange that the R. this occurs only when java files are created.

I checked the information on the Internet and did not find any solution to my problem. Then I checked my code from start to end and did not find any exceptions at first. Suddenly, when I looked at the code in the file header, I found a suspicious code import android. r; after I tried to delete this line of code, it turned out to be okay. Now I have not figured out why, but my problem has been solved. If anyone else knows, please let me know!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.