I find out why, the lantern VPN set the proxy for terminal
> https_proxy=[http://127.0.0.1:42117/](http://127.0.0.1:42117/)
> http_proxy=[http://127.0.0.1:42117/](http://127.0.0.1:42117/)
> no_proxy=localhost,127.0.0.0/8,::1
After unset these proxy, it runs well
发生如下报错,解决方式如上:
~/flutter_app$ flutter build apk
Running "flutter packages get" in flutter_app...
The setter 'readEventsEnabled=' was called on null.
Receiver: null
Tried calling: readEventsEnabled=false
package:pub/src/source/hosted.dart 344 BoundHostedSource._throwFriendlyError
package:pub/src/source/hosted.dart 144 BoundHostedSource.doGetVersions
===== asynchronous gap ===========================
package:pub/src/source.dart 168 BoundSource.getVersions
package:pub/src/solver/package_lister.dart 77 PackageLister._versions.<fn>.<fn>
dart:async runZoned
package:pub/src/http.dart 274 withDependencyType
package:pub/src/solver/package_lister.dart 76 PackageLister._versions.<fn>
===== asynchronous gap ===========================
dart:async new Future.sync
package:async/src/async_memoizer.dart 43 AsyncMemoizer.runOnce
package:pub/src/solver/package_lister.dart 75 PackageLister._versions
package:pub/src/solver/package_lister.dart 112 PackageLister.countVersions
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 377 VersionSolver._choosePackageVersion.<fn>
===== asynchronous gap ===========================
package:pub/src/utils.dart 351 minByAsync
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 373 VersionSolver._choosePackageVersion
===== asynchronous gap ===========================
package:pub/src/solver/version_solver.dart 120 VersionSolver.solve
===== asynchronous gap ===========================
package:pub/src/solver.dart 35 resolveVersions.<fn>
package:pub/src/log.dart 409 progress
package:pub/src/solver.dart 32 resolveVersions
package:pub/src/entrypoint.dart 207 Entrypoint.acquireDependencies
===== asynchronous gap ===========================
package:pub/src/command/get.dart 38 GetCommand.run
package:args/command_runner.dart 194 CommandRunner.runCommand
===== asynchronous gap ===========================
package:pub/src/command_runner.dart 168 PubCommandRunner.runCommand.<fn>
dart:async new Future.sync
package:pub/src/utils.dart 116 captureErrors.<fn>
dart:async runZoned
package:pub/src/utils.dart 135 captureErrors
package:pub/src/command_runner.dart 168 PubCommandRunner.runCommand
===== asynchronous gap ===========================
package:pub/src/command_runner.dart 117 PubCommandRunner.run
===== asynchronous gap ===========================
/b/build/slave/Mac_Engine/build/src/third_party/dart/third_party/pkg/pub/bin/pub.dart 8 main
This is an unexpected error. Please run
pub --trace --verbosity=warning get --no-precompile
and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
pub get failed (1)