Missing documentation tip on constraints for installation of Android Studio for "flutter doctor" to identify its version
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 50/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- android, linux
调研方向
从 src/content/get-started/install/linux/android.md 和 Configure the Android toolchain in Android Studio 部分开始。检查安装指南和链接的 Check your development setup 部分,然后记录其中针对 /opt/android-studio 和 $HOME 的限制以及前置命令;当提示准确说明 flutter doctor 如何识别 Android Studio 版本时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Page URL
https://docs.flutter.dev/get-started/install/linux/android/
Page source
https://github.com/flutter/website/tree/main/src/content/get-started/install/linux/android.md
Describe the problem
The Android Studio documentation suggests that it can be installed anywhere one likes on Linux. And in practice it might be the case. But i've just spent long hours trying to figure out why "flutter doctor" could not identify the version of my installation of android-studio.
I refused to install a tool in the user account where i do my development. It turns out that the only other place that "flutter doctor" will find android-studio is under /opt/android-studio. But that is not enough. It won't identify its version if there is an additional level of hierarchy under that. So for instance, do not install it under /opt/android-studio/2025.1.1 or /opt/android-studio/current.
Also i wanted "flutter doctor" to work out of the box, without a prior execution of android-studio, because it should be independent of the sequence in which the tools are run by me or any other user on the Linux station. It turns out that i had to run 2 additional commands before "flutter doctor" would finally identify the version number of Android Studio.
flutter config --android-studio-dir=/opt/android-studio
echo "/opt/android-studio" | tr -d '\n' > ~/.cache/Google/$(cat /opt/android-studio/product-info.json | jq -r '.dataDirectoryName')/.home
I'm assuming that "flutter doctor" would not flag the version identification as an issue if it weren't important.
The 2nd command would not be required if it were performed by flutter config.
The constraints on /opt/android-studio could be slackened if an env var were introduced for ANDROID_STUDIO_ROOT or, as on MacOS, the flutter doctor checked the contents of prduct-info.json.
A new user cannot be expected to guess or reverse engineer this.
Expected fix
Add a tip under https://docs.flutter.dev/get-started/install/linux/android#configure-the-android-toolchain-in-android-studio
On Linux, for "flutter doctor" (see https://docs.flutter.dev/get-started/install/linux/android#check-your-development-setup) to identify the installed version of Android Studio, it must either be installed in /opt/android-studio or in your $HOME. If it is installed in /opt/android-studio, it must not have an additional hierarchy level such as /opt/android-studio/2025.1.1 or /opt/android-studio/current.
Until "flutter doctor" is fixed, you have to run these two commands before running "flutter doctor":
flutter config --android-studio-dir=/opt/android-studio
echo "/opt/android-studio" | tr -d '\n' > ~/.cache/Google/$(cat /opt/android-studio/product-info.json | jq -r '.dataDirectoryName')/.home
Additional context
No response
I would like to fix this problem.
- I will try and fix this problem on docs.flutter.dev.
- 主要语言
- Dart
- 星标
- 3.1k
- 派生
- 3.5k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 88
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flutter/website 的其他 Issue
-
act.await-dev-pr co.request d.new-feature dev.flavors e1-hours p2-medium st.blocked t.cli-tools target.web
难度 2/5 1-3 小时 新手友好度 78/100
flutter/website#14165 · 1 条评论 ·
维护者通常 1 天内回复
-
a.fwe a.tut.tutorial co.PRs-welcome co.volunteer e0-minutes fix.bug fix.examples from.page-issue p2-medium
难度 2/5 1-3 小时 新手友好度 62/100
flutter/website#14158 · 1 条评论 ·
维护者通常 1 天内回复
-
act.await-dev-pr d.enhancement e1-hours p2-medium st.blocked target.web
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
from.page-issue p2-medium
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Document the `use-explicit-plural-values` gen-l10n option可能重新可做 @busradansmn 于 27 天前认领,目前没有进行中的 PR。 未关闭act.await-dev-pr d.enhancement e0-minutes p2-medium t.cli-tools t.i18n t.l10n
难度 2/5 1-3 小时 新手友好度 82/100
flutter/website#13993 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
lang-java needs-triage package:jni package:jni_flutter package:jnigen
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
finamp-app/finamp#1920 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
flutter/flutter#197796 · 1 条评论 ·
维护者通常 1 天内回复