Solve all kinds of wonderful appcompat mistakes

Source: Internet
Author: User

One, dependence/detachment AppCompat

In the new version of Google with a new dependency package, this package contains V4 and v7 things, as long as your compiled version compile with is 4.0 that is above, then the default depends on the AppCompat package, you can not get out of it anyway. If you're going to leave him, you can build a compiled version of an application such as 2.3,2.2, so you don't rely on the package.

Based on practical experience, we can no longer build a 2.x platform application, so we have to get along well with this appcompat. So we should understand the following points:

1.appcompat will make an error when deleted, it will be generated automatically after the new project.

2.appcompat will affect your R file and you may lose the R file when you cancel your dependency. The workaround is to delete or modify the XML file incorrectly before you can regain the R file

3.appcompat has its own properties, if you define the attribute property and it has the same name, then you have to change the names. This is the point of the Android egg ache, should pay attention to.

4.appcompat has its own version of the build, if its version is high, your program version is low, so that you are dependent on the problem of finding resources can not be found. So keep it consistent or higher than the build version. Of course you can also modify the compiled version of it.

Ii. supportV4 Packet Conflict

Program error said that the application of V4 and AppCompat in the V4 inconsistent. This is common because appcompat are frequently updated, so it is easy to appear inconsistent. The solution is to remove the dependencies, delete your own v4, and then go to the build path----Library, delete the private library, and then add the dependencies again. Of course the key point is to try not to make an error in the XML file, so it is difficult to regenerate the R file.

Iii. Resource errors in AppCompat

This error is basically the result of the update, because the new resource file is updated, but your AppCompat compiled version is still old, you can fix the problem by improving its compiled version in the AppCompat property and then cleaning it up. But then comes the problem of projects that depend on it, as well as the need to improve the build. Of course, you can also keep the appcompat you have not upgraded before, depending on the situation depends on it.

Fix the errors in AppCompat

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.