bit setup --platforms android fails with MSB4044 on Linux with no Android SDK or JDK
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- android, csharp
- 领域
- build-system, mobile
调研方向
Start in ProjectSteps.cs at AndroidDependenciesAsync and compare its InstallAndroidDependencies arguments with the other call that builds android.csproj. Reproduce on Linux without a JDK or Android SDK, then check how the target receives AndroidSdkDirectory and JavaSdkDirectory. Done means setup installs the dependencies or reports what is missing, and the Android setup command succeeds in the reported environment.
由索引模型根据 Issue 内容生成。
描述
What happens
On a Linux machine that has neither a JDK nor an Android SDK, bit setup --platforms android stops at the Android step and exits with 1, although that step is the one meant to install them:
✗ Couldn't install the Android SDK and Java MSB4044
The build it runs reports:
warning XA0034: Failed to get the Java SDK version. Please ensure you have Java 11.0 or above installed.
warning XA5300: The Android SDK directory could not be found.
error MSB4044: The "InstallAndroidDependencies" task was not given a value for the required parameter "AndroidSdkPath".
How to reproduce
- Use bit CLI 11.0.0-pre-17 on Ubuntu 24.04 with no JDK, no Android SDK, and neither
JAVA_HOMEnorANDROID_HOMEset. I used aghcr.io/catthehacker/ubuntu:pwsh-24.04container, running the project's CI locally withact. - In a bit Boilerplate project that has the MAUI app, run
bit setup --yes --platforms android --no-build --no-browsers.
Cause
ProjectSteps.AndroidDependenciesAsync runs:
dotnet build <Maui project> -t:InstallAndroidDependencies -f net10.0-android -p:AcceptAndroidSDKLicenses=True
Nothing tells InstallAndroidDependencies where to install. With no SDK to discover, AndroidSdkPath is empty and the task can't start. develop still builds the same arguments (checked at 99911c947).
GitHub's hosted runners hide this, since they come with a JDK and an Android SDK and set both variables.
With a JDK 17, the Android command-line tools and platform-tools already in the image, and JAVA_HOME and ANDROID_HOME set, the same command passes.
Suggested fix
When no SDK or JDK can be found, pass install locations to the target, for example -p:AndroidSdkDirectory=<dir> -p:JavaSdkDirectory=<dir> under the user's home folder. Otherwise, fail with a message saying what to install. The same applies to the other InstallAndroidDependencies call in ProjectSteps.cs, the one that builds android.csproj.
I only tested this on Linux. I don't know whether Windows or macOS without an SDK behave the same way.
- 主要语言
- C#
- 星标
- 1.4k
- 派生
- 264
- 平均合并
- 7 小时 38 分钟
- 30 天内合并 PR
- 544
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitfoundation/bitplatform 的其他 Issue
-
BitVariantVariablesBrowserTests fails on the scrolled variables of BitHeader可能已有人在做 @yasmoradi 今天认领。 未关闭area / BlazorUI
难度 2/5 1-3 小时 新手友好度 75/100
bitfoundation/bitplatform#15485 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
bitfoundation/bitplatform#15051 ·
维护者通常 1 天内回复
-
Prerelease `v-11.0.0-pre-25`可能已有人在做 @yasmoradi 今天认领。 未关闭prerelease
bitfoundation/bitplatform#15482 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Project dependencies are outdated可能已有人在做 @yasmoradi 今天认领。 未关闭dependencies
难度 3/5 1-2 天 新手友好度 25/100
bitfoundation/bitplatform#15480 ·
维护者通常 1 天内回复
-
Bswup's AlwaysPrerender mode doesn't open the cached app when the server is down可能已有人在做 @msynk 今天认领。 未关闭area / bswup
bitfoundation/bitplatform#15479 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 bitfoundation/bitplatform 的全部 Issue
相似的 Issue
-
chore interpreter small
难度 2/5 1-3 小时 新手友好度 73/100
hexide-io/HexIDE#5718 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
PCL-Community/PCL-CE#3907 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
chore
难度 1/5 1-3 小时 新手友好度 88/100
lugassawan/swe-workbench#841 ·
-
aikido high security
难度 1/5 1 小时以内 新手友好度 66/100
dequelabs/axe-core-nuget#312 ·