AndroidManifest.xml showing me 10 errors in the code below. I am unable to understand why it is showing these errors and how can I resolve this. Help me out from these errors.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.buis_talk">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:requestLegacyExternalStorage="true"
android:label="buis_talk"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:usesCleartextTraffic="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>
Errors are:-
- android:requestLegacyExternalStorage="true" – "Attribute android:requestLegacyExternalStorage is not allowed here"
- android:name="${applicationName}" – "Unresolvedclass:'{applicationName}’"
- android:icon="@mipmap/ic_launcher"> – "Attribute android:icon is not allowed here"
- android:name=".MainActivity" – "Unresolved class MainActivity"
- android:usesCleartextTraffic="true" – "Attribute android:usesCleartextTraffic is not allowed here"
- android:launchMode="singleTop" – "Attribute android:launchMode is not allowed here"
- android:theme="@style/LaunchTheme" – "Attribute android:theme is not allowed here"
- android:configChanges="….." – "Attribute android:configChanges is not allowed here"
- android:hardwareAccelerated="true" – "Attribute android:hardwareAccelerated is not allowed here"
- android:windowSoftInputMode="adjustResize"> – "Attribute android:windowSoftInputMode is not allowed here"
2
Answers
TLDR
I think if you open the android folder separately in Android Studio, then you should be able to see properly. (Maybe, I’m not sure).
Long answer
Android Studio can’t understand the
Android
content when aFlutter
project is opened.If it’s a simple Android project, then it can easily understand the Gradle files and your Java/Kotlin.
What this means for you as a Flutter developer is that, when you are editing native Android or iOS code. You will not get code completion. Android Studio will not be able to tell you about the errors in your code.
The Flutter team is working on this. So that you can have all the cool IntelliJ features for editing Native code EVEN when you have a Flutter project is opened.
Also, I think if you open the android separately, then you should be able to see properly. (Maybe, I’m not sure).
If project is getting failed when you run it then as it is showing in attached image; at the end of line no 29 that a
z
is added mistakenly.And project is running fine but you are worried about code being red/wrong; just ignore it as @powerman23rus explained it in detail.
Also if point 1 & 2 is not applicable then you have to post full error logs for us to trace the issue origins.