Problem with android manifest when creating flutter appbundle

3,646

Solution 1

Ok, you have a space character between android and name while defining internet permission. You need to remove that:

  <uses-permission android:name="android.permission.INTERNET" android:maxSdkVersion="28" />
 

Solution 2

I was able to find the issue. The issue was that there was an unnecessary space after android here: <uses-permission android: name="android.permission.INTERNET" android:maxSdkVersion="28" />

I changed this to : <uses-permission android:name="android.permission.INTERNET" android:maxSdkVersion="28" />

Share:
3,646
Alfie Anil
Author by

Alfie Anil

Don't eat yellow snow...

Updated on December 26, 2022

Comments

  • Alfie Anil
    Alfie Anil over 1 year

    I have a problem with the android xml file when creating the appBundle. However, I cannot find the problem, could anyone help me please? I have never removed anything from the file. I have never really worked with manifest files before, so I wasn't completely sure what I was looking for. Thanks in advance

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="-----------------">
        <!-- io.flutter.app.FlutterApplication is an android.app.Application that
             calls FlutterMain.startInitialization(this); in its onCreate method.
             In most cases you can leave this as-is, but you if you want to provide
             additional functionality it is fine to subclass or reimplement
             FlutterApplication and put your custom class here. -->
             <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <uses-permission android:name="android.permission.VIBRATE" />
        <uses-permission android:name="android.permission.WAKE_LOCK" />
        <application
            android:name=".Application"
            android:label="Pravachaka Sabdam"
            android:icon="@mipmap/ic_launcher"
            android:usesCleartextTraffic="true">
    
            <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                    <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                </intent-filter>
            </receiver>
            <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
    
            <activity
                android:name="io.flutter.embedding.android.FlutterActivity"
                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"
                android:showWhenLocked="true"
                android:turnScreenOn="true"
                >
                <meta-data
                        android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                        android:value="true" />
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
                <intent-filter>
                    <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                    <category android:name="android.intent.category.DEFAULT" />
                </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>
    
        <uses-permission android: name="android.permission.INTERNET" android:maxSdkVersion="28" />
    
    </manifest>
    

    Error Message

    Error parsing LocalFile: 'A:\Flutter\BETA TEST FOLDER\Android\one\android\app\src\main\AndroidManifest.xml' Please ensure that the android manifest is a valid XML document andtry again.
    
    • Akif
      Akif over 3 years
      What is the problem?
    • Alfie Anil
      Alfie Anil over 3 years
      This is what it says: Error parsing LocalFile: 'A:\Flutter\BETA TEST FOLDER\Android\one\android\app\src\main\AndroidManifest.xml' Please ensure that the android manifest is a valid XML document andtry again.
    • bad_coder
      bad_coder over 3 years
      @AlfieAnil please edit the question and include the error message in the post instead of putting it in a comment.
  • Alfie Anil
    Alfie Anil over 3 years
    Thank you. hahah I just answered my question before seeing this haha. Thank you