bit setup --platforms android fails with MSB4044 on Linux with no Android SDK or JDK
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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分
- マージ済み PR(30日)
- 544
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
-
chore
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
lugassawan/swe-workbench#841 ·
-
aikido high security
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
dequelabs/axe-core-nuget#312 ·
-
[Bug]: reply would start a thread under a targeted message if its payload carried a reply chain idオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信