Android Studio Post-upgrade project build failed.

Source: Internet
Author: User

Recently after upgrading Android studio, found that the original can be compiled through the project, suddenly compiled, because the generated androidmanifest.xml file is garbled.

After Upgrade:

Android Studio 0.6.0

Build Tools 19.1.0

Android SDK Tools 22.6.4.

Gradle 0.11.+

Error message:

Error Info
Error: (one) Error parsing Xml:not well-formed (invalid token)
Error: (one) execution failed for task ':p rocessdebugresources '.
> com.android.ide.common.internal.LoggedErrorException:Failed to Run Command:
C:\Program files\android\android-studio\sdk\build-tools\19.1.0\aapt.exe package-f--no-crunch-i C:\Program Files\ Android\android-studio\sdk\platforms\android-17\android.jar-m D:\work\Adapter\TestProj\build\intermediates\ Manifests\debug\androidmanifest.xml-s D:\work\Adapter\TestProj\build\intermediates\res\debug-A D:\work\Adapter\ Testproj\build\intermediates\assets\debug-m-j D:\work\Adapter\TestProj\build\generated\source\r\debug-F D:\work\ ADAPTER\TESTPROJ\BUILD\INTERMEDIATES\LIBS\TESTPROJ-DEBUG.AP_--debug-mode--custom-package xxx.xxx.xxx-0 apk
Error Code:
1
Output:
D:\work\adapter\testproj\build\intermediates\manifests\debug\androidmanifest.xml:11:error:error parsing Xml:not Well-Formed (Invalid token)


During the compilation process:

During the compilation process, the generated manifest file was originally a Chinese note where it became garbled:
---->original Androidmanifest

<!--allows programs to send SMS--    <uses-permission android:name= "Android.permission.SEND_SMS"/>


---->generate menifest during compile. [D:\work\Adapter\TestProj\build\intermediates\manifests\debug\AndroidManifest.xml]
Messy Code here-->
<!--?????????? --    <uses-permission android:name= "Android.permission.RECEIVE_SMS"/>


This problem bothered me for several days and finally found a solution:

In the Build.gradle file, add:

Useoldmanifestmerger true

Android {    compilesdkversion    buildtoolsversion "19.1.0"    useoldmanifestmerger true ......... ...}
Recompile, you can compile the pass, the generated manifest file is not garbled.

Online says Gradle plugin 0.11 enables the new Manifestmerger by default

There are still problems in estimating the new Manifestmerger.


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.