Missing required flag --file after Flutter and Dart SDKs upgrade - android

I am having a problem running my Flutter App after Windows update. Other than that I am having a few bugs in AndroidManifest.xml
I have tried running flutter doctor but it does not show me what the problem is. I also did flutter clear and then flutter pub get and it did not solve this problem either. Before this message error I updated my Flutter and Dart SDK.
This is also my Andriodmanifest.xml file
`<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.profile_page">
<application
android:requestLegacyExternalStorage="true"
android:label="profile_page"
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" />
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCkNkiPQe4l4f_wUvwrEvVScS6ZkX79Ln0" />
</application>
`

Related

how to resolve "Attribute android: ~ is not allowed here" in android app?

When I run device(emulator) in android studio, it occures some error like below pictures.
enter image description here
I attached code below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.egolium">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:label="egolium"
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"></meta-data>
<!-- android:name="com.google.android.gms.ads.APPLICATION_ID"-->
<!-- android:value="{admob_appId}"-->
/>
<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>
I tried restart in the menu that 'invalidate cache', but it still be same.
or when I remove the codes, it occures more errors
Could you let me know why it occures and how to resolve these?

Class referenced in the manifest, was not found in the project or the libraries

I am having a problem with my manifest file and searched everywhere and could not find a solution. Could someone kindly check my Manifest file and let me know why I get the following error:
Class referenced in the manifest, com.yalantis.ucrop.UCropActivity, was not found in the project or the libraries
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.blabber_tech">
<application
android:label="blabber_tech"
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" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
</application> </manifest>

How to add '.in' domain for flutter app to avoid Android resource linking error?

I'm making a flutter project with the cmd:
flutter create --org in.fiesto lafiesto
This command puts 'in' under backticks- `in` in the MainActivity.kt file because 'in' is a keyword.
When I run the app it throws the following error:
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:/home/abhi/Documents/Fiesto/lafiesto/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:2: AAPT: error: attribute 'package' in tag is not a valid Android package name: '`in`.fiesto.lafiesto'.
This package name in the build/.../AndroidManifest.xml file:
package="`in`.fiesto.lafiesto"
The contents of MAinActivity.kt are:
package `in`.fiesto.lafiesto
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
And the android>src> AndroidManifest.xml file has:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.fiesto.lafiesto">
<application
android:label="lafiesto"
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>
The android>debug AndroidManifest.xml file has:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.fiesto.lafiesto">
<application
android:label="lafiesto"
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>
I tried changing minSdk, targetSdk, compileSdk and other things in build.gradle file and also tried changing "package=in.fiesto.lafiesto" to "package=`in`.fiesto.lafiesto" in AndroidManifest.xml files but nothing worked.
Please suggest how to deal with this problem.
flutter create -i objc -a java --org in.fiesto lafiesto solved the problem. It created a Java folder under android>src>main which has two folders named "in" and "io", there's no kotlin folder. I don't know if this will have any drawbacks or not!

Flutter-Please ensure that the android manifest is a valid XML document and try again

Here I am getting an error while run flutter project.
*** Error parsing LocalFile: 'D:\DEVELOPMENT\Paklayer\park_app\android\app\src\main\AndroidManifest.xml' Please
ensure that the android manifest is a valid XML document and try again. ***
Here is my Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.park_app">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<android:usesCleartextTraffic="true">
<application
android:name="io.flutter.app.FlutterApplication"
android:label="park_app"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
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"/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"/>
<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> ```
Add this line inside application tag : <android:usesCleartextTraffic="true">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.park_app">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="park_app"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
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"/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Dont 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>
For more info : https://developer.android.com/guide/topics/manifest/application-element

Flutter Android Launch Image does not change / display

Flutter 2.10.3
According to doc and this article. launch_image should work fine.
But it is not displayed. When the application is launched, the application icon is displayed, instead of my custom launch_image
As you can see on screenshot below, launch_image is displayed in Android studio.
Background color works fine.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.untitled">
<application
android:label="untitled"
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>
Also, pls do not suggest packages like flutter_native_splash. I need to know, how make it works without packages

Categories

Resources