bit setup --platforms android fails with MSB4044 on Linux with no Android SDK or JDK
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- android, csharp
- Ambito
- build-system, mobile
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 1.4k
- Fork
- 264
- Merge medio
- 7h 38m
- PR unite (30g)
- 544
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bitfoundation/bitplatform
-
BitVariantVariablesBrowserTests fails on the scrolled variables of BitHeaderForse già presa @yasmoradi l’ha presa oggi. Apertaarea / BlazorUI
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bitfoundation/bitplatform#15485 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bitfoundation/bitplatform#15051 ·
I maintainer di solito rispondono entro 1 giorno
-
Prerelease `v-11.0.0-pre-25`Forse già presa @yasmoradi l’ha presa oggi. Apertaprerelease
bitfoundation/bitplatform#15482 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Project dependencies are outdatedForse già presa @yasmoradi l’ha presa oggi. Apertadependencies
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
bitfoundation/bitplatform#15480 ·
I maintainer di solito rispondono entro 1 giorno
-
Bswup's AlwaysPrerender mode doesn't open the cached app when the server is downForse già presa @msynk l’ha presa oggi. Apertaarea / bswup
bitfoundation/bitplatform#15479 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di bitfoundation/bitplatform
Issue simili
-
chore interpreter small
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
hexide-io/HexIDE#5718 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
NeoForge 安装任务的子任务描述有误Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
PCL-Community/PCL-CE#3907 ·
I maintainer di solito rispondono entro 1 giorno
-
chore
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
lugassawan/swe-workbench#841 ·
-
aikido high security
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
dequelabs/axe-core-nuget#312 ·
-
[Bug]: reply would start a thread under a targeted message if its payload carried a reply chain idApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno