After the Android SDK is updated in Eclipse, problems related to the appcompat_v7 project occur in the new project. androidappcompatv7

Source: Internet
Author: User

After the Android SDK is updated in Eclipse, problems related to the appcompat_v7 project occur in the new project. androidappcompatv7

After Eclipse updated the Android SDK, various problems occurred in new projects, and various online solutions have been implemented for a long time.

1. error: Error retrieving parent for item: No resource found that matches the given name 'android: Widget. Material. ActionButton'

After the new project is created, error: Error retrieving parent for item: No resource found that matches the given name 'android: Widget. Material. actionclick' appears'


This is because the Target SDK and Compile With do not select the latest API21 when creating a project.

Solution 1: Create a new project. Select API21 for both Target SDK and Compile:



Solution 2:

Right-click the appcompat_v7 Project and the new Project-properties, and select Android 5.0 from the Android-Project Build Target file. Note: The Is Library of the appcompat_v7 Project must be selected.




2. The appcompat_v7 \ bin \ appcompat_v7.jar file is missing.

If both Target SDK and Compile With select API21, but the generated project still has an error, the appcompat_v7 \ bin \ appcompat_v7.jar file is missing ,:


After the project is created, in addition to the "test" project we created in the workspace column, you will find a package named "appcompat_v7, in addition, this package shows an error (red x), while the "Hello" package shows a red exclamation point.


Solution: click "Project" in the menu bar, select "Clean", and click "OK". After "Clean" is completed, you will find that the appcompat_v7 package has an error and the Hello package has a red warning problem solved.


Although I do not quite understand it, it should be because after the Android SDK is updated, some Android5.0 code is found in the appcompat_v7 project loaded by the tool after the new project is created, resulting in errors, in fact, this Android plug-in is not very intelligent. This will be done first, and we will have a deeper understanding in the future.

Appendix: appcompat_v7 Function

1. appcompat_v7: Application compatibility package. V7 indicates version 7, that is, android2.1. This compatibility package supports systems later than version 2.1.
2. recently, Google officially used the compatible jar package and some resource files separately to create an android project, which is actually a resource library. Right-click this project to go to build path-click android, you will find that the is library is a library. In fact, this library can be shared by multiple projects. The library already contains the v7.jar package and some suitable resources. When developing multiple projects, you can share some common code, resources are stored in the database for ease of use. The library is not automatically generated when a project is created in a lower version of ADT. However, you can create a project and check the is library. The advanced version of ADT automatically generates a library. If you do not need it, you only need to right-click Properties -- android -- library under your new project and select the library. Then, click remove to remove the library.
3. When your application is packaged or running, the Library is automatically packaged and compiled as part of the project.


Reference: http://jingyan.baidu.com/article/3ea51489e04eb852e61bbaa4.html


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.