编译报错:
Attribute application@name value=(io.dcloud.HelloH5.wxapi.Application) from AndroidManifest.xml:141:9-59
is also present at [lib.5plus.base-release.aar] AndroidManifest.xml:157:9-63 value=(io.dcloud.application.DCloudApplication).
Suggestion: add ‘tools:replace=“android:name”’ to element at AndroidManifest.xml:140:5-495:19 to override.
异常原因:
引入的jar包/arr包中的AndroidManifest.xml文件中也配置了android:name属性
解决办法:
在AndroidManifest.xml的根标签下加上 xmlns:tools=“http://schemas.android.com/tools”,然后在application标签下加入tools:replace=“android:name”。如下所示
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.***.***">
<application android:name="com.***.***"
android:allowBackup="true"
android:icon="@mipmap/app_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:name">
</application>
</manifest>