报错:

    1. Resolving dependencies... 1.4s
    2. /Users/bianxiang/swapwallet-app/android/app/src/main/AndroidManifest.xml:13:13-64 Error:
    3. Attribute provider#androidx.core.content.FileProvider@authorities value=(com.einsh.swap_app.fileProvider) from [:flutter_bugly] AndroidManifest.xml:13:13-64
    4. is also present at [:flutter_webview_plugin] AndroidManifest.xml:11:13-64 value=(com.einsh.swap_app.fileprovider).
    5. Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:11:9-19:20 to override.
    6. /Users/bianxiang/swapwallet-app/android/app/src/main/AndroidManifest.xml:18:17-55 Error:
    7. Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:flutter_bugly] AndroidManifest.xml:18:17-55
    8. is also present at [:flutter_webview_plugin] AndroidManifest.xml:17:17-50 value=(@xml/filepaths).
    9. Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
    10. FAILURE: Build failed with an exception.
    11. * What went wrong:
    12. Execution failed for task ':app:processReleaseManifest'.
    13. > Manifest merger failed with multiple errors, see logs
    14. * Try:
    15. 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.
    16. * Get more help at https://help.gradle.org

    报错里有提示在manifest里加tools:replace=”android:authorities”和android:resource,记得在最外层加上xmlns:tools=”http://schemas.android.com/tools

    以下是改动后的最新的manifest文件:

    1. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    2. xmlns:tools="http://schemas.android.com/tools"
    3. package="com.clcw.kx.chekaixin">
    4. <uses-permission android:name="android.permission.WAKE_LOCK" />
    5. <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
    6. <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    7. <!-- 获取网络状态,根据网络状态切换进行数据请求网络转换 -->
    8. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    9. <!-- 访问网络,进行地图相关业务数据请求,包括地图数据,路线规划,POI检索等 -->
    10. <uses-permission android:name="android.permission.INTERNET" />
    11. <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    12. <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    13. <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
    14. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    15. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    16. <application
    17. android:name="cn.kx.kxcustomerapp.MainApplication"
    18. android:label="车开新二手车"
    19. android:icon="@mipmap/ic_launcher"
    20. android:usesCleartextTraffic="true"
    21. tools:replace="android:name">
    22. <meta-data
    23. android:name="com.baidu.lbsapi.API_KEY"
    24. android:value="VGSTa35snCq5uEFfPV3PHoCHWg0whPu0"/>
    25. <activity
    26. android:name="cn.kx.kxcustomerapp.MainActivity"
    27. android:launchMode="singleTop"
    28. android:theme="@style/LaunchTheme"
    29. android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
    30. android:hardwareAccelerated="true"
    31. android:windowSoftInputMode="adjustResize">
    32. <intent-filter>
    33. <action android:name="android.intent.action.MAIN"/>
    34. <category android:name="android.intent.category.LAUNCHER"/>
    35. </intent-filter>
    36. </activity>
    37. <meta-data
    38. android:name="flutterEmbedding"
    39. android:value="2" />
    40. <provider
    41. android:name="androidx.core.content.FileProvider"
    42. android:authorities="${applicationId}.fileProvider"
    43. android:exported="false"
    44. android:grantUriPermissions="true"
    45. tools:replace="android:authorities">
    46. <meta-data
    47. android:name="android.support.FILE_PROVIDER_PATHS"
    48. android:resource="@xml/filepaths"
    49. tools:replace="android:resource" />
    50. </provider>
    51. </application>
    52. </manifest>