Reputation: 27
I am working on a Flutter (3.29.0) project on Android Studio (Build #AI 231.9392.1.2311.11330709, built on January 19, 2024 Runtime version: 17.0.10+10-b829.27 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Hedgehog | 2023.1.1 Patch 2) and tried to add some permissions to my app/src/main/AndroidManifest.xml
file. As i add the permissions and save the file, raised 9 errors (8 Attribute and 1 Unresolved Class errors) and i could not figured out how to fix it. This is my first project on Flutter and Android Studio so, please consider this before answer. Thank you.
Here's my app/src/main/AndroidManifest.xml
related lines
<application
android:label="thefingerofhope"
android:icon="@mipmap/ic_launcher">
<!-- Main Activity -->
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Intent filter for launching the app -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Flutter embedding meta-data -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Queries for processing text -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
And the error messages are :
Attribute android:icon is not allowed here
Unresolved class 'MainActivity'
Attribute android:launchMode is not allowed here
Attribute android:taskAffinity is not allowed here
Attribute android:theme is not allowed here
Attribute android:configChanges is not allowed here
Attribute android:hardwareAccelerated is not allowed here
Attribute android:windowSoftInputMode is not allowed here
Attribute android:mimeType is not allowed here
Upvotes: 1
Views: 37
Reputation: 45
Add this line at the top:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
and this at the end:
</manifest>
Upvotes: 0