安装Flutter Launcher URL遇<queries>元素错误,求解决(已升级Gradle)
解决Flutter Launcher URL安装时的元素错误
你的编译错误根源很明确:
修改后的AndroidManifest.xml代码
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.cozy_app"> <uses-permission android:name="android.permission.INTERNET"/> <!-- Provide required visibility configuration for API level 30 and above --> <queries> <!-- If your app checks for SMS support --> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="sms" /> </intent> <!-- If your app checks for call support --> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="tel" /> </intent> </queries> <application android:label="cozy_app" android:name="${applicationName}" android:icon="@mipmap/launcher_icon"> <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"/> <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>
额外检查项(如果修改后仍有问题)
- 确认你的Android Gradle Plugin(AGP)版本与Gradle版本匹配:比如Gradle 7.0+对应AGP 7.0及以上版本,AGP版本过低会无法识别
标签。 - 确保项目的compileSdkVersion设置为30或更高(在
android/app/build.gradle中配置)。
内容的提问来源于stack exchange,提问作者Nio Zihni
相关产品推荐
相关产品推荐

