skip to Main Content

flutter run build apk –release
However, I am encountering the following error:

Target file "build" not found.
I expected the APK to be built, but instead, the command fails.

Here are the details of my environment:

Flutter version: 3.24.1
Dart version:Dart 3.5.1
OS: Windows 11
I have tried running flutter clean and flutter pub get before running the command again, but the issue persists.

Am I using the wrong command or missing a configuration step? Any help would be appreciated.

3

Answers


  1. You can simply use flutter build apk
    also check if you have internet added on your AndroidManifest file
    Open the file "android/app/src/main/AndroidManifest.xml" and add the proper user-permission:

    <manifest> 
    ...
     <uses-permission android:name="android.permission.INTERNET"/>
    ...
    </manifest>
    
    Login or Signup to reply.
  2. Long story short, yes, you are using wrong command đŸ™‚ For your use case it is flutter build apk. No need for run since it’s another command and no need for --release since it’s default mode when building apk.

    Good luck!

    Login or Signup to reply.
  3. use flutter build apk --release don’t use as flutter run build apk –release won’t work.

    now try to build apk

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search