The following example of how to import samples to Android SDK reports an error!

Source: Internet
Author: User

I don't know if you have this error. Right-click --> New --> Android project --> Create project from existing source, select the example below sample for import, and R will not be found. java file also prompts that match_parent is invalid.

I found some explanations on the Internet. After experiment, I found that I could do this:

1. During the first import, select another version of build target. If the base fails, it will change to a higher value. After the import, you will find that the match_parent is invalid. Don't worry. Check your R. java, right?

2. Delete the project you just imported. Note: Do not delete the local file. Then import the SDK, but this time you will need to break the SDK where the example is located. For example, if I import the notepad example in asamples \ Android-8, select Android 2.2, and then finish, how about R. if Java does exist, match_parent will not prompt that it is invalid?



Check that match_parent is a layout that was created only in version 2.2. Therefore, the SDK Before Version 2.2 will prompt that it is invalid!

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.