简体   繁体   English

这段代码有什么问题。当我清理 flutter 依赖项并运行 flutter pub get 时,我收到了这个错误。 我必须做些什么来修复这个错误

[英]What's wrong with this code.When I clean the flutter dependencies and run flutter pub get then I got this error. What I have to do to fixed this error

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bpls">
<uses-permission android:name="android.permission.INTERNET"/>
     <!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> -->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
   <application
        android:label="bpls"
        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:showWhenLocked="true"
            android:turnScreenOn="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>

Error parsing LocalFile: 'C:\Users\prashant\Desktop\bpls\android\app\src\main\AndroidManifest.xml' Please ensure that the android manifest is a valid XML document and try again. Error parsing LocalFile: 'C:\Users\prashant\Desktop\bpls\android\app\src\main\AndroidManifest.xml' 请确保 android 清单是有效的 XML 文档,然后重试。

You Just Need to Replace this with your AndroidManifest.xml你只需要用你的 AndroidManifest.xml 替换它

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bpls">
<uses-permission android:name="android.permission.INTERNET"/>
     <!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> -->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
   <application
        android:label="bpls"
        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"/>
                <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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在我尝试过的 flutter 代码中遇到了这些错误(flutter clean - flutter pub get - flutter 升级 - 缓存修复)所有这些都不起作用 - I got these error in my flutter code I've tried (flutter clean - flutter pub get - flutter upgrade - cache repair) all of it didn't work 我在 Windows 上运行 flutter 应用程序时遇到此错误 - I Have got this error when i run flutter app on windows 当我尝试运行我的颤振代码时出现此错误 - I got this error when I tried to run my flutter code 我是 android dev 的新手,我尝试安装 flutter 但出现此错误。 接下来做什么? - I am new at android dev and I tried to install flutter but getting this error. What to do next? flutter:不是“字符串”类型错误的子类型。 我应该纠正什么? - flutter: not subtype of type 'String' error. What should I correct? 当我在我的设备上运行 flutter 应用程序时出现错误 - When I run flutter app on my device I got error flutter:“图像”不是“字符串”类型的子类型错误。 我能做些什么? - flutter: 'Image' is not a subtype of type 'String' Error. What can I do? 当我运行我的 flutter vs 代码时出现错误 - I get an error when i Run my flutter vs code 当我将新的 package 添加到依赖项时,Flutter pub 失败 - Flutter pub get failed when I add new package to dependencies 我已删除 Pub\Cache\hosted\pub.dartlang.org 文件夹以更新 flutter 包,但在 flutter 包中显示错误 - i have ddeleted Pub\Cache\hosted\pub.dartlang.org folder to update the flutter packages but showing error in flutter packages get
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM