我有一个使用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刮刀输出
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!
先谢谢你的帮助
1条答案
按热度按时间kkbh8khc1#
你能试着这样做吗?
在您的机器上导航到下面提到的
locations
并执行相同的cleanup
。假设您使用的是
MacOSX
另外,如果这不起作用,则打开
Android studio
,转到File -> Invalidate Caches / Restart
希望这能帮上忙。