Recently after upgrading Android studio, found that the original can be compiled through project, suddenly compiled just, 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 stare where the place became garbled:
---->original Androidmanifest
<!--consent program 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 way to solve it:
Add to Build.gradle file?:
Useoldmanifestmerger true
Android { compilesdkversion buildtoolsversion "19.1.0" useoldmanifestmerger true ......... ...}
Compile again, you can compile the pass, the generated manifest file is not garbled.
Online says Gradle plugin 0.11 enables the new Manifestmerger by default
The new Manifestmerger is expected to remain problematic.