报错:
Resolving dependencies... 1.4s
/Users/bianxiang/swapwallet-app/android/app/src/main/AndroidManifest.xml:13:13-64 Error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(com.einsh.swap_app.fileProvider) from [:flutter_bugly] AndroidManifest.xml:13:13-64
is also present at [:flutter_webview_plugin] AndroidManifest.xml:11:13-64 value=(com.einsh.swap_app.fileprovider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:11:9-19:20 to override.
/Users/bianxiang/swapwallet-app/android/app/src/main/AndroidManifest.xml:18:17-55 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:flutter_bugly] AndroidManifest.xml:18:17-55
is also present at [:flutter_webview_plugin] AndroidManifest.xml:17:17-50 value=(@xml/filepaths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
报错里有提示在manifest里加tools:replace=”android:authorities”和android:resource,记得在最外层加上xmlns:tools=”http://schemas.android.com/tools“
以下是改动后的最新的manifest文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.clcw.kx.chekaixin">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- 获取网络状态,根据网络状态切换进行数据请求网络转换 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:name="cn.kx.kxcustomerapp.MainApplication"
android:label="车开新二手车"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
tools:replace="android:name">
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="VGSTa35snCq5uEFfPV3PHoCHWg0whPu0"/>
<activity
android:name="cn.kx.kxcustomerapp.MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"
tools:replace="android:resource" />
</provider>
</application>
</manifest>