Able to avoid connecting to internet access required domains/hosts(github.com, cocoapods.org) in flutter commands
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
We have an isolated build environment with no direct internet access.
We have set `PUB_HOSTED_URL` and `FLUTTER_STORAGE_BASE_URL` environment variables, pointing to our internal pub server.
When we then run any flutter command, for example:
```console
flutter doctor -v
```
this command always runs for nearly 2 minutes without any output and then prints the following error:
```console
Command exited with code 128: git fetch --tags
Standard error: fatal: unable to access 'https://github.com/flutter/flutter.git/': Failed to connect to github.com port 443: Connection timed out
```
I would here not expect that Flutter tries to contact https://github.com/flutter/flutter.git/
Maybe some kind of offline mode is here missing, which avoids connects to https://github.com/,
and as in the "flutter doctor" output seen also https://cocoapods.org/.
Doctor output
```console
[✓] Flutter (Channel stable, 3.27.3, on Rocky Linux 9.5 (Blue Onyx) 5.14.0-503.14.1.el9_5.x86_64, locale en_US)
• Flutter version 3.27.3 on channel stable at /usr/local/jenkins/workdir/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c519ee916e (3 weeks ago), 2025-01-21 10:32:23 -0800
• Engine revision e672b006cb
• Dart version 3.6.1
• DevTools version 2.40.2
• Pub download mirror https://pubdevintern/repository/pubdev/
• Flutter download mirror https://pubdevintern/repository/pubdev/
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
• clang version 18.1.8 (RESF 18.1.8-3.el9)
• cmake version 3.26.5
• ninja version 1.10.2
• pkg-config version 1.7.3
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Rocky Linux 9.5 (Blue Onyx) 5.14.0-503.14.1.el9_5.x86_64
[!] Network resources
✗ A network error occurred while checking "https://cocoapods.org/": Connection failed
✗ A network error occurred while checking "https://github.com/": Connection timed out
! Doctor found issues in 4 categories.
```
Contributor guide
Assessment
This issue has not been assessed yet.