gpt4 book ai didi

android - flutter Unresolved 类 'ApplicationName'

转载 作者:行者123 更新时间:2023-12-02 18:08:00 25 4
gpt4 key购买 nike

我想将我的应用程序上传到 git,它给出了一个警告,当我说显示警告时,我得到了这样的错误。我刚刚打开android文件夹并同步,但我无法得到结果。只有在尝试将我的项目上传到 git 时才会出现此问题。我尝试了很多方法但都失败了我该如何解决这个问题?

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.apmatik"
tools:ignore="MissingVersion">
<application
android:label="apmatik"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
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">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="flutterEmbedding"
android:value="2"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

最佳答案

解决方案一:

在我们的 app/build.gradle 中手动设置 manifestPlaceholders:

android {

defaultConfig {

// Add This line
manifestPlaceholders = [applicationName: "android.app.Application"]
}

}

解决方案 2:在 app/build.gradle 中添加此代码:

    buildTypes {
release {
manifestPlaceholders = [applicationName: "android.app.Application"]
}

debug {
manifestPlaceholders = [applicationName: "android.app.Application"]
}
build{
manifestPlaceholders = [applicationName: "android.app.Application"]
}
}

关于android - flutter Unresolved 类 'ApplicationName',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72892180/

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