AndroidManifest.xml未知属性报错与应用主屏幕图标缺失问题求助
Flutter项目AndroidManifest属性报错及主屏幕图标缺失问题
我用Android Studio开发的Flutter项目可以正常运行,但遇到两个问题:
- AndroidManifest.xml文件中多个属性被下划线标注,鼠标悬停时提示“未知属性”,但这些属性根据官方文档是合法的。
- 应用安装后,启动图标仅出现在应用托盘,未显示在主屏幕。
以下是我的相关文件和信息,恳请帮忙解决:
AndroidManifest.xml代码
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.sevocab"> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/> <application android:label="SE Vocab" 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="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.VIEW" /> <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>
报错截图

flutter doctor输出结果
flutter doctor -v [✓] Flutter (Channel stable, 3.7.11, on macOS 12.6.3 21G419 darwin-x64, locale en-US) • Flutter version 3.7.11 on channel stable at /Users/lk/programs/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f72efea43c (3 days ago), 2023-04-11 11:57:21 -0700 • Engine revision 1a65d409c7 • Dart version 2.19.6 • DevTools version 2.20.1 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at /Users/lk/Library/Android/sdk • Platform android-33, build-tools 33.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.76.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.60.0 [✓] Connected device (3 available) • Pixel 2 XL (mobile) • 806KPDT1944522 • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-x64 • macOS 12.6.3 21G419 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.49 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found!
内容的提问来源于stack exchange,提问作者Yogi Wannabe
相关产品推荐
相关产品推荐

