<p dir="auto">As said in android's doc (<a href="https://developer.android.com/studio/command-line/variables" rel="nofollow">https://developer.android.com/studio/command-line/variables</a>), <code class="notranslate">ANDROID_HOME</code> is deprecated and should migrate to <code class="notranslate">ANDROID_SDK_ROOT</code>.</p>
<p dir="auto">This weekend I was providing assistance as <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sobrienpdx/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sobrienpdx">@sobrienpdx</a> tried to install Flutter on a brand new Mac laptop.  After installing xcode, but not yet running it for the first time, Flutter Doctor produced the following output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ flutter doctor


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.


Building flutter tool...
Doctor summary (to see all details, run flutter doctor -v):
 
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Error executing simctl: 69


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.



Failed to send crash report. Server responded with HTTP status code 400
Crash report written to .../flutter_01.log;
please let us know at https://github.com/flutter/flutter/issues.
$"><pre class="notranslate"><code class="notranslate">$ flutter doctor


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.


Building flutter tool...
Doctor summary (to see all details, run flutter doctor -v):
 
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Error executing simctl: 69


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.



Failed to send crash report. Server responded with HTTP status code 400
Crash report written to .../flutter_01.log;
please let us know at https://github.com/flutter/flutter/issues.
$
</code></pre></div>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">(This is my best recollection of how the problem arose; launching xcode for the first time fixed the problem so I can't verify that this is a correct repro)</p>
<ol dir="auto">
<li>Acquire a fresh MacOS computer that has not yet had xcode run on it.</li>
<li>Download and install xcode using the App store, but do not open it.</li>
<li>Download and install Flutter.</li>
<li>Run "flutter doctor".</li>
</ol>
<h2 dir="auto">Logs</h2>
<p dir="auto">Contents of flutter_01.log:</p>
<blockquote>
<p dir="auto">Flutter crash report; please file at <a href="https://github.com/flutter/flutter/issues">https://github.com/flutter/flutter/issues</a>.</p>
<h2 dir="auto">command</h2>
<p dir="auto">flutter doctor</p>
<h2 dir="auto">exception</h2>
<p dir="auto">VersionCheckError: VersionCheckError: Command exited with code 69: git log -n 1 --pretty=format:%ad --date=iso<br>
Standard error:</p>
<p dir="auto">Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#0      _runSync (package:flutter_tools/src/version.dart:491:5)
#1      FlutterVersion._latestGitCommitDate (package:flutter_tools/src/version.dart:129:12)
#2      FlutterVersion.frameworkCommitDate (package:flutter_tools/src/version.dart:120:37)
#3      FlutterVersion.frameworkDate (package:flutter_tools/src/version.dart:83:31)
#4      _FlutterValidator.validate (package:flutter_tools/src/doctor.dart:398:45)
&lt;asynchronous suspension&gt;
#5      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:56)
#6      Doctor.diagnose (package:flutter_tools/src/doctor.dart:183:42)
&lt;asynchronous suspension&gt;
#7      DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
&lt;asynchronous suspension&gt;
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#9      _asyncThenWrapperHelper.&lt;anonymous closure&gt; (dart:async/runtime/libasync_patch.dart:77:64)
#10     _rootRunUnary (dart:async/zone.dart:1132:38)
#11     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#13     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#14     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#15     Future._complete (dart:async/future_impl.dart:476:7)
#16     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#17     _AsyncAwaitCompleter.complete.&lt;anonymous closure&gt; (dart:async/runtime/libasync_patch.dart:33:20)
#18     _rootRun (dart:async/zone.dart:1124:13)
#19     _CustomZone.run (dart:async/zone.dart:1021:19)
#20     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:947:23)
#21     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#22     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#23     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#24     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)"><pre class="notranslate"><code class="notranslate">#0      _runSync (package:flutter_tools/src/version.dart:491:5)
#1      FlutterVersion._latestGitCommitDate (package:flutter_tools/src/version.dart:129:12)
#2      FlutterVersion.frameworkCommitDate (package:flutter_tools/src/version.dart:120:37)
#3      FlutterVersion.frameworkDate (package:flutter_tools/src/version.dart:83:31)
#4      _FlutterValidator.validate (package:flutter_tools/src/doctor.dart:398:45)
&lt;asynchronous suspension&gt;
#5      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:56)
#6      Doctor.diagnose (package:flutter_tools/src/doctor.dart:183:42)
&lt;asynchronous suspension&gt;
#7      DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
&lt;asynchronous suspension&gt;
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#9      _asyncThenWrapperHelper.&lt;anonymous closure&gt; (dart:async/runtime/libasync_patch.dart:77:64)
#10     _rootRunUnary (dart:async/zone.dart:1132:38)
#11     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#13     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#14     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#15     Future._complete (dart:async/future_impl.dart:476:7)
#16     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#17     _AsyncAwaitCompleter.complete.&lt;anonymous closure&gt; (dart:async/runtime/libasync_patch.dart:33:20)
#18     _rootRun (dart:async/zone.dart:1124:13)
#19     _CustomZone.run (dart:async/zone.dart:1021:19)
#20     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:947:23)
#21     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#22     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#23     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#24     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
</code></pre></div>
<h2 dir="auto">flutter doctor</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="encountered exception: VersionCheckError: Command exited with code 69: git log -n 1 --pretty=format:%ad --date=iso
Standard error: 

Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.




#0      _runSync (package:flutter_tools/src/version.dart:491:5)
#1      FlutterVersion._latestGitCommitDate (package:flutter_tools/src/version.dart:129:12)
#2      FlutterVersion.frameworkCommitDate (package:flutter_tools/src/version.dart:120:37)
#3      FlutterVersion.frameworkDate (package:flutter_tools/src/version.dart:83:31)
#4      _FlutterValidator.validate (package:flutter_tools/src/doctor.dart:398:45)
&lt;asynchronous suspension&gt;
#5      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:56)
#6      Doctor.diagnose (package:flutter_tools/src/doctor.dart:183:42)
&lt;asynchronous suspension&gt;
#7      _doctorText.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:194:26)
#8      AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:142:29)
&lt;asynchronous suspension&gt;
#9      _rootRun (dart:async/zone.dart:1124:13)
#10     _CustomZone.run (dart:async/zone.dart:1021:19)
#11     _runZoned (dart:async/zone.dart:1516:10)
#12     runZoned (dart:async/zone.dart:1463:12)
#13     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
&lt;asynchronous suspension&gt;
#14     _doctorText (package:flutter_tools/runner.dart:193:19)
&lt;asynchronous suspension&gt;
#15     _createLocalCrashReport (package:flutter_tools/runner.dart:171:32)
&lt;asynchronous suspension&gt;
#16     _handleToolError (package:flutter_tools/runner.dart:126:33)
&lt;asynchronous suspension&gt;
#17     run.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:63:20)
&lt;asynchronous suspension&gt;
#18     AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:142:29)
&lt;asynchronous suspension&gt;
#19     _rootRun (dart:async/zone.dart:1124:13)
#20     _CustomZone.run (dart:async/zone.dart:1021:19)
#21     _runZoned (dart:async/zone.dart:1516:10)
#22     runZoned (dart:async/zone.dart:1463:12)
#23     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
&lt;asynchronous suspension&gt;
#24     runInContext (package:flutter_tools/src/context_runner.dart:42:24)
&lt;asynchronous suspension&gt;
#25     run (package:flutter_tools/runner.dart:50:10)
#26     main (package:flutter_tools/executable.dart:52:9)
&lt;asynchronous suspension&gt;
#27     main (file:///Users/shaunnaobrien/development_tools/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#28     _startIsolate.&lt;anonymous closure&gt; (dart:isolate/runtime/libisolate_patch.dart:287:32)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)"><pre class="notranslate"><code class="notranslate">encountered exception: VersionCheckError: Command exited with code 69: git log -n 1 --pretty=format:%ad --date=iso
Standard error: 

Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.




#0      _runSync (package:flutter_tools/src/version.dart:491:5)
#1      FlutterVersion._latestGitCommitDate (package:flutter_tools/src/version.dart:129:12)
#2      FlutterVersion.frameworkCommitDate (package:flutter_tools/src/version.dart:120:37)
#3      FlutterVersion.frameworkDate (package:flutter_tools/src/version.dart:83:31)
#4      _FlutterValidator.validate (package:flutter_tools/src/doctor.dart:398:45)
&lt;asynchronous suspension&gt;
#5      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:56)
#6      Doctor.diagnose (package:flutter_tools/src/doctor.dart:183:42)
&lt;asynchronous suspension&gt;
#7      _doctorText.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:194:26)
#8      AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:142:29)
&lt;asynchronous suspension&gt;
#9      _rootRun (dart:async/zone.dart:1124:13)
#10     _CustomZone.run (dart:async/zone.dart:1021:19)
#11     _runZoned (dart:async/zone.dart:1516:10)
#12     runZoned (dart:async/zone.dart:1463:12)
#13     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
&lt;asynchronous suspension&gt;
#14     _doctorText (package:flutter_tools/runner.dart:193:19)
&lt;asynchronous suspension&gt;
#15     _createLocalCrashReport (package:flutter_tools/runner.dart:171:32)
&lt;asynchronous suspension&gt;
#16     _handleToolError (package:flutter_tools/runner.dart:126:33)
&lt;asynchronous suspension&gt;
#17     run.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:63:20)
&lt;asynchronous suspension&gt;
#18     AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:142:29)
&lt;asynchronous suspension&gt;
#19     _rootRun (dart:async/zone.dart:1124:13)
#20     _CustomZone.run (dart:async/zone.dart:1021:19)
#21     _runZoned (dart:async/zone.dart:1516:10)
#22     runZoned (dart:async/zone.dart:1463:12)
#23     AppContext.run (package:flutter_tools/src/base/context.dart:141:18)
&lt;asynchronous suspension&gt;
#24     runInContext (package:flutter_tools/src/context_runner.dart:42:24)
&lt;asynchronous suspension&gt;
#25     run (package:flutter_tools/runner.dart:50:10)
#26     main (package:flutter_tools/executable.dart:52:9)
&lt;asynchronous suspension&gt;
#27     main (file:///Users/shaunnaobrien/development_tools/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#28     _startIsolate.&lt;anonymous closure&gt; (dart:isolate/runtime/libisolate_patch.dart:287:32)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
</code></pre></div>
</blockquote>