eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

Local builds not working on windows

Open yousefelgoharyx opened this issue 3 years ago • 59 comments

Build/Submit details page URL

No response

Summary

Expo local builds are not working on windows. Whenever I run eas build --profile preview --platform android --local. I get the following message: Error: Unsupported platform, macOS or Linux is required to build apps for Android. If eas-cli does not support building Android apps on windows that would be very frustrating because I would like to build on my machine not on your cloud service.

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.22621 Binaries: Node: 18.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8309675 npmPackages: expo: ~48.0.4 => 48.0.4 react: 18.2.0 => 18.2.0 react-native: 0.71.3 => 0.71.3 Expo Workflow: managed // -> I have windows 11 btw

┌─────────────────────────────────────────────────────────────────────────┐ │ │ │ There is a new version of expo-cli available (6.3.2). │ │ You are currently using expo-cli 5.4.11 │ │ Install expo-cli globally using the package manager of your choice; │ │ for example: npm install -g expo-cli to get the latest version │ │ │ └─────────────────────────────────────────────────────────────────────────┘ √ Found all copies of expo-modules-autolinking All copies of expo-modules-autolinking satisfy ~1.1.0 √ Found all copies of @expo/config-plugins All copies of @expo/config-plugins satisfy ~6.0.0 √ Found all copies of @expo/prebuild-config All copies of @expo/prebuild-config satisfy ~6.0.0

🎉 Didn't find any issues with the project!

Error output

Error: Unsupported platform, macOS or Linux is required to build apps for Android.

Reproducible demo or steps to reproduce from a blank project

Idk just run a local android build on Windows.

yousefelgoharyx avatar Feb 27 '23 10:02 yousefelgoharyx

Message is correct, windows is not supported. You can still use eas build --local on windows inside WSL or run npx expo prebuild and bulid from android studio.

Note that WSL technically it's not officially supported(we do not test it), but it seems to work well.

wkozyra95 avatar Feb 27 '23 17:02 wkozyra95

Message is correct, windows is not supported. You can still use eas build --local on windows inside WSL or run npx expo prebuild and bulid from android studio.

Note that WSL technically it's not officially supported(we do not test it), but it seems to work well.

I tried npx expo prebuild and build from android studio, but it gives be development build of app as apk, not the original apps apk. How to fix that?

sc0rp10n-py avatar Jun 05 '23 08:06 sc0rp10n-py

If you have dev client configured in your project then Debug build will include dev client and Release will not. Just build release version of an APK

wkozyra95 avatar Jun 05 '23 08:06 wkozyra95

Ah yes, you can only build for android OS on an Apple OS. Likewise you can only run a build for iOS directly on an android phone. Otherwise you are welcome to line up in the EAS free queue for decades until both platforms are obsolete.

openSourcerer9000 avatar Jun 08 '23 16:06 openSourcerer9000

Message is correct, windows is not supported. You can still use eas build --local on windows inside WSL or run npx expo prebuild and bulid from android studio. Note that WSL technically it's not officially supported(we do not test it), but it seems to work well.

I tried npx expo prebuild and build from android studio, but it gives be development build of app as apk, not the original apps apk. How to fix that?

You will need to sign the apk with a keystore on android studio for it to build a release apk tutorial for creating a keystore and signing an apk: https://developer.android.com/studio/publish/app-signing#sign-apk

oculosdanilo avatar Jun 08 '23 23:06 oculosdanilo

Update to this issue I did get it building on WSL (Ubuntu 22) and can provide instructions if wanted, you cannot use the raw android-sdk, you have to install android studio, make sure the android-sdk is uninstalled and then you can build it. Happy to help if anyone needs help building on WSL. Took me like 3 days to figure all of this out.

OOCAZ avatar Oct 19 '23 20:10 OOCAZ

Update to this issue I did get it building on WSL (Ubuntu 22) and can provide instructions if wanted, you cannot use the raw android-sdk, you have to install android studio, make sure the android-sdk is uninstalled and then you can build it. Happy to help if anyone needs help building on WSL. Took me like 3 days to figure all of this out.

@OOCAZ i would really appreciate this. I tried it but im getting an error when trying to use any eas command like login or build --local. The error is following:

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:

lucawernicke avatar Oct 26 '23 21:10 lucawernicke

Update to this issue I did get it building on WSL (Ubuntu 22) and can provide instructions if wanted, you cannot use the raw android-sdk, you have to install android studio, make sure the android-sdk is uninstalled and then you can build it. Happy to help if anyone needs help building on WSL. Took me like 3 days to figure all of this out.

@OOCAZ i would really appreciate this. I tried it but im getting an error when trying to use any eas command like login or build --local. The error is following:

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:

Hey @LujoTheRealOne. Could you give some more verbose errors? The only thing I can think of off the top of my head is, do you have the eas-cli installed globally?

Let me know and we can work through this.

OOCAZ avatar Oct 26 '23 21:10 OOCAZ

Update to this issue I did get it building on WSL (Ubuntu 22) and can provide instructions if wanted, you cannot use the raw android-sdk, you have to install android studio, make sure the android-sdk is uninstalled and then you can build it. Happy to help if anyone needs help building on WSL. Took me like 3 days to figure all of this out.

@OOCAZ i would really appreciate this. I tried it but im getting an error when trying to use any eas command like login or build --local. The error is following:

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:

Hey @LujoTheRealOne. Could you give some more verbose errors? The only thing I can think of off the top of my head is, do you have the eas-cli installed globally?

Let me know and we can work through this.

Hey @OOCAZ, you were right, I figured it out already. Thx. But now I'm facing the next issue. The console is telling me, that it can't locate the Ndk and no SDK provided but I installed openjdk and an SDK.

lucawernicke avatar Oct 26 '23 22:10 lucawernicke

Update to this issue I did get it building on WSL (Ubuntu 22) and can provide instructions if wanted, you cannot use the raw android-sdk, you have to install android studio, make sure the android-sdk is uninstalled and then you can build it. Happy to help if anyone needs help building on WSL. Took me like 3 days to figure all of this out.

@OOCAZ i would really appreciate this. I tried it but im getting an error when trying to use any eas command like login or build --local. The error is following:

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:

Hey @LujoTheRealOne. Could you give some more verbose errors? The only thing I can think of off the top of my head is, do you have the eas-cli installed globally?

Let me know and we can work through this.

Hey @OOCAZ, you were right, I figured it out already. Thx. But now I'm facing the next issue. The console is telling me, that it can't locate the Ndk and no SDK provided but I installed openjdk and an SDK.

So you cannot install the default SDK, you have to uninstall it and then install Android studio for Linux. Once you do that it will walk you through the standard setup and prompt you to install the SDK suite. But if you do not have the old default SDK uninstalled it won't allow you to install the Android Studio SDK.

Ping me again if none of that makes sense.

OOCAZ avatar Oct 26 '23 22:10 OOCAZ

So you cannot install the default SDK, you have to uninstall it and then install Android studio for Linux. Once you do that it will walk you through the standard setup and prompt you to install the SDK suite. But if you do not have the old default SDK uninstalled it won't allow you to install the Android Studio SDK.

Ping me again if none of that makes sense.

@OOCAZ You know how to install Android Studio on Linux Ubuntu WSL? It's only a command prompted system.

lucawernicke avatar Oct 26 '23 22:10 lucawernicke

So you cannot install the default SDK, you have to uninstall it and then install Android studio for Linux. Once you do that it will walk you through the standard setup and prompt you to install the SDK suite. But if you do not have the old default SDK uninstalled it won't allow you to install the Android Studio SDK.

Ping me again if none of that makes sense.

@OOCAZ You know how to install Android Studio on Linux Ubuntu WSL? It's only a command prompted system.

Yep. Just download it for Linux, unzip the tar and then navigate inside of it to the studio.sh and execute it. Then it will create a UI for you to finish the install.

I know it's weird, but it's what I did to get it working.

OOCAZ avatar Oct 26 '23 22:10 OOCAZ

So you cannot install the default SDK, you have to uninstall it and then install Android studio for Linux. Once you do that it will walk you through the standard setup and prompt you to install the SDK suite. But if you do not have the old default SDK uninstalled it won't allow you to install the Android Studio SDK.

Ping me again if none of that makes sense.

@OOCAZ You know how to install Android Studio on Linux Ubuntu WSL? It's only a command prompted system.

Yep. Just download it for Linux, unzip the tar and then navigate inside of it to the studio.sh and execute it. Then it will create a UI for you to finish the install.

I know it's weird, but it's what I did to get it working.

Oh okay, I will try it out tomorrow. Shut down my Laptop already. Thanks for your time!

lucawernicke avatar Oct 26 '23 22:10 lucawernicke

Portanto, você não pode instalar o SDK padrão, é necessário desinstalá-lo e instalar o Android Studio para Linux. Depois de fazer isso, você será guiado pela configuração padrão e solicitará que você instale o pacote SDK. Mas se você não tiver o antigo SDK padrão desinstalado, ele não permitirá a instalação do Android Studio SDK. Envie-me um ping novamente se nada disso fizer sentido.

@OOCAZVocê sabe como instalar o Android Studio no Linux Ubuntu WSL? É apenas um sistema solicitado por comando.

Sim. Basta baixá-lo para Linux, descompactar o tar e navegar dentro dele até studio.sh e executá-lo. Em seguida, ele criará uma UI para você finalizar a instalação.

Eu sei que é estranho, mas foi o que fiz para que funcionasse.

Eu tenho o mesmo problema, não faz sentido o WSL ter interface grafica, risos.

Pode me ajudar como executar minhas builds --local?

rss14 avatar Oct 27 '23 19:10 rss14

Portanto, você não pode instalar o SDK padrão, é necessário desinstalá-lo e instalar o Android Studio para Linux. Depois de fazer isso, você será guiado pela configuração padrão e solicitará que você instale o pacote SDK. Mas se você não tiver o antigo SDK padrão desinstalado, ele não permitirá a instalação do Android Studio SDK. Envie-me um ping novamente se nada disso fizer sentido.

@OOCAZVocê sabe como instalar o Android Studio no Linux Ubuntu WSL? É apenas um sistema solicitado por comando.

Sim. Basta baixá-lo para Linux, descompactar o tar e navegar dentro dele até studio.sh e executá-lo. Em seguida, ele criará uma UI para você finalizar a instalação. Eu sei que é estranho, mas foi o que fiz para que funcionasse.

Eu tenho o mesmo problema, não faz sentido o WSL ter interface grafica, risos.

Pode me ajudar como executar minhas builds --local?

Hey! It doesn't make much sense but I got it working in WSL 2 on both windows 10 and 11. I agree it's unorthodox, but it works, if you need help installing android studio specifically or have any specific errors let me know.

OOCAZ avatar Oct 28 '23 03:10 OOCAZ

I think google playstore can check the device on which you build your application. If I use WSL to build the application, it will affect my store account. If expo only supports ios and linux, it is a big disadvantage for expo. maybe I'll go back to using react native cli :(

trandung1291 avatar Nov 07 '23 17:11 trandung1291

How can this not be made more clear in the docs?! That's disastrously bad. This seems to be utterly impossible to learn beforehand. You seem to have to learn it by trail and error. I discovered this limitation just now, and am still unable to find any material mentioning it in the docs:

  • Local Builds: https://docs.expo.dev/build-reference/local-builds/
  • Android Build Process: https://docs.expo.dev/build-reference/android-builds/
  • EAS Build Limitations: https://docs.expo.dev/build-reference/limitations/

You'd imagine at least one of those articles could mention that Windows is not supported by the EAS CLI.

carleberg avatar Nov 20 '23 15:11 carleberg

This seriously doesn't work on Windows??? Are you serious now?

$ eas build --local
√ Select platform » Android
Unsupported platform, macOS or Linux is required to build apps for Android
    Error: build command failed.

изображение

suprunchuk avatar Dec 01 '23 18:12 suprunchuk

Why this is closed? Does anybody could explain the WSL method?

anandhuremanan avatar Dec 05 '23 17:12 anandhuremanan

Why this is closed? Does anybody could explain the WSL method?

I haven't found how to do this yet either.

suprunchuk avatar Dec 06 '23 08:12 suprunchuk