<p dir="auto">I am trying to setup install flutter but having an issue please check below screenshot:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/42976280/45045804-ca904880-b091-11e8-8315-b4fa71ad459d.png"><img src="https://user-images.githubusercontent.com/42976280/45045804-ca904880-b091-11e8-8315-b4fa71ad459d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Crosslink <a href="https://stackoverflow.com/questions/52171057/flutter-with-installation-error-for-1-is-not-a-valid-win32-application" rel="nofollow">https://stackoverflow.com/questions/52171057/flutter-with-installation-error-for-1-is-not-a-valid-win32-application</a></p>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Just started looking at Flutter, installed the Flutter plug in in Android Studio 3.0.1 (this added Dart, too), restarted Android Studio.<br>
Created a simple app withouth changing or adding anything on it, it is just app created by the IDE without any of my changes in it.</p>
<p dir="auto">This also installed Flutter SDK in C:\flutter, so app creation process selected that location for SDK location correctly.</p>
<p dir="auto">However, running app (on emulator), shows me this error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Finished with error: 

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses"><pre class="notranslate"><code class="notranslate">Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Finished with error: 

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses
</code></pre></div>
<p dir="auto">But when I look in Android SDK, every Build-Tools from 25.0.0 to 27.0.1 is installed including 25.0.3.</p>
<p dir="auto">Running flutter doctor --android-licenses from terminal as suggested above shows this error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Users\user\Desktop\work\flutter\first_flutter_app&gt;doctor --android-licences
'flutter' is not recognized as an internal or external command,
operable program or batch file."><pre class="notranslate"><code class="notranslate">C:\Users\user\Desktop\work\flutter\first_flutter_app&gt;doctor --android-licences
'flutter' is not recognized as an internal or external command,
operable program or batch file.
</code></pre></div>
<p dir="auto">Then I added my C:\flutter\bin to system path and tried again issuing</p>
<p dir="auto"><code class="notranslate">flutter doctor --android-licenses</code></p>
<p dir="auto">but got error<code class="notranslate"> "Unknown argument --licenses"</code>.</p>
<p dir="auto">Next I run:</p>
<p dir="auto"><code class="notranslate">flutter upgrade</code></p>
<p dir="auto">this completed, too but running my app still produced same error re license issue.</p>
<p dir="auto">flutter upgrade shows following output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Running flutter doctor...
[√] Flutter (on Microsoft Windows [Version 10.0.15063], locale en-US, channel alpha)
    • Flutter at C:\flutter
    • Framework revision d957c8f040 (4 days ago), 2017-11-30 13:29:59 -0800
    • Engine revision 77d8acb9be
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-dev.9.0

[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at C:\Program Files (x86)\Android\android-sdk
    • Unable to locate Android NDK.

    • Unable to locate compiler in Android NDK.

    • Platform android-25, build-tools 25.0.2
    • ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Connected devices
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)"><pre class="notranslate"><code class="notranslate">Running flutter doctor...
[√] Flutter (on Microsoft Windows [Version 10.0.15063], locale en-US, channel alpha)
    • Flutter at C:\flutter
    • Framework revision d957c8f040 (4 days ago), 2017-11-30 13:29:59 -0800
    • Engine revision 77d8acb9be
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-dev.9.0

[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at C:\Program Files (x86)\Android\android-sdk
    • Unable to locate Android NDK.

    • Unable to locate compiler in Android NDK.

    • Platform android-25, build-tools 25.0.2
    • ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Android Studio (version 3.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[√] Connected devices
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
</code></pre></div>
<p dir="auto">I literaly keep going in circles with this. Here is what happens when I run my app from terminal using flutter (above I explained what happens if I run it from the IDE):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter run
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                0.7s
Resolving dependencies...                                |

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses                                                                                                        /
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;&gt;flutter doctor --android-licenses
Error: Unknown argument --licenses"><pre class="notranslate"><code class="notranslate">C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter run
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                0.7s
Resolving dependencies...                                |

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses                                                                                                        /
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;&gt;flutter doctor --android-licenses
Error: Unknown argument --licenses
</code></pre></div>
<p dir="auto">Output of <code class="notranslate">flutter -v doctor --android-licenses</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter -v doctor --android-licenses
[  +23 ms] [C:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +45 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/alpha
[        ] [C:\flutter\] git rev-parse --abbrev-ref HEAD
[  +20 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] alpha
[        ] [C:\flutter\] git ls-remote --get-url origin
[  +19 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] [C:\flutter\] git log -n 1 --pretty=format:%H
[  +20 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] d957c8f040902aa3fd44b367150bde56b64cec83
[        ] [C:\flutter\] git log -n 1 --pretty=format:%ar
[  +21 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 5 days ago
[ +222 ms] C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat --licenses
**Error: Unknown argument --licenses**
Usage:
  sdkmanager [--uninstall] [&lt;common args&gt;] \
    [--package_file &lt;package-file&gt;] [&lt;packages&gt;...]
  sdkmanager --update [&lt;common args&gt;]
  sdkmanager --list [&lt;common args&gt;]

In its first form, installs, or uninstalls, or updates packages.
    &lt;package&gt; is a sdk-style path (e.g. &quot;build-tools;23.0.0&quot; or
             &quot;platforms;android-23&quot;).
    &lt;package-file&gt; is a text file where each line is a sdk-style path
                   of a package to install or uninstall.
    Multiple --package_file arguments may be specified in combination
     with explicit paths.
In its second form (with --update), currently installed packages are
    updated to the latest version.
In its third form, all installed and available packages are printed out.

Common Arguments:
    --sdk_root=&lt;sdkRootPath&gt;: Use the specified SDK root instead of the SDK containing this tool
    --channel=&lt;channelId&gt;: Include packages in channels up to &lt;channelId&gt;.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.
    --no_https: Force all connections to use http rather than https.
    --proxy=&lt;http | socks&gt;: Connect via a proxy of the given type.
    --proxy_host=&lt;IP or DNS address&gt;: IP or DNS address of the proxy to use.
    --proxy_port=&lt;port #&gt;: Proxy port to connect to.

* If the env var REPO_OS_OVERRIDE is set to &quot;windows&quot;,
  &quot;macosx&quot;, or &quot;linux&quot;, packages will be downloaded for that OS.
[ +152 ms] &quot;flutter doctor&quot; took 301ms.
[ +198 ms] ensureAnalyticsSent: 196ms
[   +2 ms] exiting with code 0"><pre class="notranslate"><code class="notranslate">C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter -v doctor --android-licenses
[  +23 ms] [C:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +45 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/alpha
[        ] [C:\flutter\] git rev-parse --abbrev-ref HEAD
[  +20 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] alpha
[        ] [C:\flutter\] git ls-remote --get-url origin
[  +19 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] [C:\flutter\] git log -n 1 --pretty=format:%H
[  +20 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] d957c8f040902aa3fd44b367150bde56b64cec83
[        ] [C:\flutter\] git log -n 1 --pretty=format:%ar
[  +21 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 5 days ago
[ +222 ms] C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat --licenses
**Error: Unknown argument --licenses**
Usage:
  sdkmanager [--uninstall] [&lt;common args&gt;] \
    [--package_file &lt;package-file&gt;] [&lt;packages&gt;...]
  sdkmanager --update [&lt;common args&gt;]
  sdkmanager --list [&lt;common args&gt;]

In its first form, installs, or uninstalls, or updates packages.
    &lt;package&gt; is a sdk-style path (e.g. "build-tools;23.0.0" or
             "platforms;android-23").
    &lt;package-file&gt; is a text file where each line is a sdk-style path
                   of a package to install or uninstall.
    Multiple --package_file arguments may be specified in combination
     with explicit paths.
In its second form (with --update), currently installed packages are
    updated to the latest version.
In its third form, all installed and available packages are printed out.

Common Arguments:
    --sdk_root=&lt;sdkRootPath&gt;: Use the specified SDK root instead of the SDK containing this tool
    --channel=&lt;channelId&gt;: Include packages in channels up to &lt;channelId&gt;.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.
    --no_https: Force all connections to use http rather than https.
    --proxy=&lt;http | socks&gt;: Connect via a proxy of the given type.
    --proxy_host=&lt;IP or DNS address&gt;: IP or DNS address of the proxy to use.
    --proxy_port=&lt;port #&gt;: Proxy port to connect to.

* If the env var REPO_OS_OVERRIDE is set to "windows",
  "macosx", or "linux", packages will be downloaded for that OS.
[ +152 ms] "flutter doctor" took 301ms.
[ +198 ms] ensureAnalyticsSent: 196ms
[   +2 ms] exiting with code 0
</code></pre></div>
<p dir="auto">However, if I navigate to my Android\sdk\tools\bin, I do have sdkmanager and issuing sdkmanager --licenses from there shows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Users\user\AppData\Local\Android\sdk\tools\bin&gt;sdkmanager --licenses
All SDK package licenses accepted.======] 100% Computing updates..."><pre class="notranslate"><code class="notranslate">C:\Users\user\AppData\Local\Android\sdk\tools\bin&gt;sdkmanager --licenses
All SDK package licenses accepted.======] 100% Computing updates...
</code></pre></div>
<p dir="auto">So, it looks like Flutter is full of bugs at the moment.<br>
I have several circular problems where it says it cannot find a command, but the command exists as explained above.<br>
I followed exact installation steps in flutter documentation, they seem to be simple and all I did seem to be correct.</p>
<h2 dir="auto">Logs</h2>
<p dir="auto">Run your application with <code class="notranslate">flutter run</code> and attach all the log output.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter run
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                2.8s
Resolving dependencies...                                /

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses                                                                                                        -
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;"><pre class="notranslate"><code class="notranslate">
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter run
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                2.8s
Resolving dependencies...                                /

* Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 25.0.3

To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses                                                                                                        -
C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;
</code></pre></div>
<p dir="auto">Run <code class="notranslate">flutter analyze</code> and attach any output of that command also.</p>
<p dir="auto">C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter analyze<br>
Analyzing C:\Users\user\Desktop\work\flutter\flutter_app_myapp...<br>
No issues found!<br>
Ran in 4.9s</p>
<h2 dir="auto">Flutter Doctor</h2>
<p dir="auto">Paste the output of running <code class="notranslate">flutter doctor</code> here.</p>
<p dir="auto">C:\Users\user\Desktop\work\flutter\flutter_app_myapp&gt;flutter doctor<br>
[√] Flutter (on Microsoft Windows [Version 10.0.15063], locale en-US, channel alpha)<br>
• Flutter at C:\flutter<br>
• Framework revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/d957c8f040902aa3fd44b367150bde56b64cec83/hovercard" href="https://github.com/flutter/flutter/commit/d957c8f040902aa3fd44b367150bde56b64cec83"><tt>d957c8f</tt></a> (5 days ago), 2017-11-30 13:29:59 -0800<br>
• Engine revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/77d8acb9be65e6725c7c4292fe2e3b1159c0aeb9/hovercard" href="https://github.com/flutter/flutter/commit/77d8acb9be65e6725c7c4292fe2e3b1159c0aeb9"><tt>77d8acb</tt></a><br>
• Tools Dart version 1.25.0-dev.11.0<br>
• Engine Dart version 2.0.0-dev.9.0</p>
<p dir="auto">[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)<br>
• Android SDK at C:\Program Files (x86)\Android\android-sdk<br>
• Unable to locate Android NDK.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="• Unable to locate compiler in Android NDK.

• Platform android-25, build-tools 25.0.2
• ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)"><pre class="notranslate"><code class="notranslate">• Unable to locate compiler in Android NDK.

• Platform android-25, build-tools 25.0.2
• ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
</code></pre></div>
<p dir="auto">[√] Android Studio (version 3.0)<br>
• Android Studio at C:\Program Files\Android\Android Studio<br>
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)</p>
<p dir="auto">[√] Connected devices<br>
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)</p>
<blockquote>
<p dir="auto">For more information about diagnosing and reporting Flutter bugs, please see <a href="https://flutter.io/bug-reports/" rel="nofollow">https://flutter.io/bug-reports/</a>.</p>
</blockquote>