gpt4 book ai didi

android - Flutter AndroidManifest 错误

转载 作者:IT王子 更新时间:2023-10-29 06:51:56 34 4
gpt4 key购买 nike

我刚刚将一个在早期版本的 Flutter 和 Android studio 中构建的项目移植到新机器上并更新了软件。尝试在模拟器中构建我的 Android 项目时,出现以下错误...

  • 出了什么问题:任务“:app:processDebugManifest”执行失败。

    Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35 is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override.

这就是我的 list 的样子...

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.myfavkpopflutterexample"
xmlns:tools="http://schemas.android.com/tools"
>

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application android:name="io.flutter.app.FlutterApplication" android:label="myfavkpopflutter_example" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
tools:replace="android:value"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

我已经添加了建议的 tools:replace="android:value" 但我仍然遇到同样的错误。我见过类似的问题,仅适用于 Android Studio。我将其添加到 SO 中是因为我认为它可能与我的 Flutter 构建有关。

最佳答案

我也遇到了同样的问题。我通过应用错误消息中的建议解决了问题。添加工具:replace="android:label"在 (\android\app\src\main\AndroidManifest.xml) 添加 tools:replace="android:label"像这样:

<application
tools:replace="android:label"
android:name="io.flutter.app.FlutterApplication"
android:label="flutterwp"
android:icon="@mipmap/ic_launcher">

不要忘记添加这样的工具:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wp"
xmlns:tools="http://schemas.android.com/tools">

关于android - Flutter AndroidManifest 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49961613/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com