'No application found for TargetPlatform.android_x86
This's my first flutter App and for some reason the Android launcher icon stopped showing so I was trying to fix that, I did a bunch of things and ended up with this error.
- flutter doctor shows everything is fine.
- ios version builds just fine.
p.s I ran flutter create. with no luck.
The IDE log
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.
Solution 1:[1]
I solved this by flutter clean.
Solution 2:[2]
Add package back in the manifest file.
Android Studio 'Chipmunk' (2021.2.1) had recommended that I remove package in AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
And it added namespace in android/app/build.gradle:
namespace 'com.example'
This didn't immediately break my app, but after cleaning everything, it broke it, and the only fix was to revert, so that the package name remained in the AndroidManifest.xml, as it was before.
The error I was getting was:
package identifier or launch activity not found.
Please check /example/android/app/src/main/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_arm64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.
Solution 3:[3]
If flutter clean doesnt work manually delete build folder in project root directory.
Solution 4:[4]
I created a new project, made sure the new project runs successfully. Then I copied the android folder to the broken project.
Solution 5:[5]
Add or Update
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.name">
package="com.example.name"
Solution 6:[6]
I had these same issues, none of the above solutions worked for me. I instead solved it by
Updating my dart SDK check out the instructions here as specified in the dart document
Ran
flutter doctorafterwards and it seemed flutter couldn't find the location for my android SDK, (I don't know how) I, therefore, added it withflutter config --android-sdk /Users/<name>/Library/Android/sdk(since i am using a mac).flutter doctoronce more to confirm everything looks ok.Next I ran
flutter cleanandflutter pub get.flutter runand everything looks good.
Solution 7:[7]
in the terminal window run "flutter clean" and then "flutter pub get" It will fix it
Solution 8:[8]
I created a new flutter project and replaced the lib folder, pubspec.yaml and copied the assets folder(if any).It works!
Solution 9:[9]
For me, on removing the intent filter
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
I got this error, on putting it back the error resolved itself.
Solution 10:[10]
My short term solution is to reinstall the android studio , there is a closed issue on github https://github.com/flutter/flutter/issues/19869 tackling the exact problem but closed due to insufficient info, consider reopening it.
Solution 11:[11]
I have the same problem
I tried using the terminal of Android Studio but I could not resolve it. However, when I used
flutter create .
in the terminal of the machine, it worked perfectly solving my problem.
Solution 12:[12]
- go to your project folder .
- type flutter clean
- then run your project (it is temporary crush problem) (it occur when your system suddenly shutdown like that)
Solution 13:[13]
So I was editing intent-filter inside manifest.xml and removed few on rewriting below inside intent-filter everything got working
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Solution 14:[14]
I have solve this problem by Adding in app/main/AndroidMainifest.xml
Solution 15:[15]
Don't use flutter clean ,
I used flutter clean
It doesnt work and casuing so many errors .
then I used flutter create .
it is recreating my project and works smoothly.
Solution 16:[16]
What worked for me?
- Did a Flutter build to generate Android APK -> It was successfully built
- Then tried outrunning the Android app on the Android emulator and the device, it worked as usual.
What didn't work for me?
- Restarting the Android Studio
- Issuing
flutter clean,flutter pub get,flutter packages get - Restarting the computer
- Re-cloning the code repository and trying to run the app with a different source code instance
- Re-importing the Flutter project to Android studio
- Setting up environment variables
So the conclusion:
Most probably due to some busy times I could have closed or stopped an Android build that was ongoing and it has caused a corrupted state in some of the files in the pub cache and which had caused this issue. Got resolved this issue along with some help from my office colleague as well.
Solution 17:[17]
android build tools was not installed while after installing, it worked.
Solution 18:[18]
This error is due some miss configuration in the AndroidManifest.xml.
In my case The meta-data tag for flutterEmbedding was inside the activity tag, and this was causing the error
If you have another running project, just compare the two files and you should probably find what is wrong.
Solution 19:[19]
Issue resolved by Updating android SDK from Android Studio -> SDK Took
Also installed latest api's
Solution 20:[20]
I solved by:
Opening the terminal and running this code:
flutter cleanflutter pub getIf this doesn't work, use Ctrl+F5 and Wait for the process that run automatically
Solution 21:[21]
The issue is "fixed" when some build data is already there, for example when running flutter build apk --debug and then flutter run.
Solution 22:[22]
open terminal & write
- flutter clean
- flutter pub get
solve this problem
Solution 23:[23]
Some Cracks in apk in build got me this problem , i deleted apks in build and re run it after cashes clear . worked fine for me.
Solution 24:[24]
it always happen to me because my system is overheating and always trips off while compiling my codes. I resolved it by running "flutter clean" and after that i run "flutter run" while connected to the internet.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
