Yunnane
Yunnane

Reputation: 155

Flutter, Android Manifest issue with flutter run -t method

I need to set 2 main files for test and dev environment. When I try to run

flutter run -t test_app/lib/main.dart

I get following errors:

AndroidManifest.xml could not be found.
Please check ***/android/app/src/main/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_x86.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.

And when I use:

flutter build apk -t test_app/lib/main.dart

I get:

[!] Your app is using an unsupported Gradle project. To fix this problem, create a new project by running `flutter create -t app <app-directory>` and then move the dart code, assets and pubspec.yaml to the new
project.

I add the configuration to run this 2 different main files and it works but I need to run this from command line and that's the problem.

I saw similar issues and I tried

What can cause this issue? Any ideas how to resolve this?

Upvotes: 1

Views: 1114

Answers (2)

My Car
My Car

Reputation: 4556

Try deleting this Flutter project and create a new Flutter project.

Upvotes: 1

user12790690
user12790690

Reputation:

You can check this reference

Try to fix it by deleting the app.apk in the build/app/outputs/apk.

Upvotes: 1

Related Questions