Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local builds not working on windows #1726

Closed
yousefelgoharyx opened this issue Feb 27, 2023 · 42 comments
Closed

Local builds not working on windows #1726

yousefelgoharyx opened this issue Feb 27, 2023 · 42 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@yousefelgoharyx
Copy link

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 yousefelgoharyx added the needs review Issue is ready to be reviewed by a maintainer label Feb 27, 2023
@wkozyra95
Copy link
Contributor

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.

@sc0rp10n-py
Copy link

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?

@wkozyra95
Copy link
Contributor

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

@openSourcerer9000
Copy link

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.

@oculosdanilo
Copy link

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

@OOCAZ
Copy link

OOCAZ commented Oct 19, 2023

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.

@LujoTheRealOne
Copy link

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:

@OOCAZ
Copy link

OOCAZ commented Oct 26, 2023

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.

@LujoTheRealOne
Copy link

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.

@OOCAZ
Copy link

OOCAZ commented Oct 26, 2023

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.

@LujoTheRealOne
Copy link

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.

@OOCAZ
Copy link

OOCAZ commented Oct 26, 2023

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.

@LujoTheRealOne
Copy link

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!

@rss14
Copy link

rss14 commented Oct 27, 2023

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?

@OOCAZ
Copy link

OOCAZ commented Oct 28, 2023

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.

@trandung1291
Copy link

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 :(

@carleberg
Copy link

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:

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

@suprunchuk
Copy link

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.

изображение

@ananduremanan
Copy link

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

@suprunchuk
Copy link

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

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

@OOCAZ
Copy link

OOCAZ commented Dec 23, 2023

@ananduremanan I can explain it, but essentially you just install the linux version of android studio on wsl and it will work. I can give more in depth set of steps if you want. @suprunchuk same for you too.

@crystalarcus
Copy link

crystalarcus commented Jan 2, 2024

@ananduremanan I can explain it, but essentially you just install the linux version of android studio on wsl and it will work. I can give more in depth set of steps if you want. @suprunchuk same for you too.

Hello there 👋, I have been facing hard time figuring out how to build expo preview or development build offline.
So I discovered EAS with --local flag don't support windows, and installed ubuntu on WSL ( I am high schooler and linux OS is something new to me). So this is how it went :
*** long ( and painful) story ahead, if you are short on time, you may skip and go to END***
------------------------------Start------------------------------------------------------
Figuring out how ubuntu works, and accessing my project files on windows in wsl.
Ran eas build in it hoping it works but oh well.... it said Java is not installed.
Installed Java
ran eas build --local
It started downloading gradle-8.0.1-all.zip ( I thought it would use gradle i am using for windows, by this time i realized ubuntu wont take environment variables from windows )
Stopped download, installed gradle and did path setting. ( limited internet, so i wanted to get it worked with gradle's zip i had locally on windows )
Ran eas build --local
IT STARTED DOWNLOADING GRADLE AGAIN !
I stopped it, than found out, I have to change distributionURL in gradle-wrapper.properties to locally installed zip.
changed it and ran eas and wow it really worked, ( for 10 sec and than....)
I got error about android sdk don't have linux.something ( I set the ANDROID_HOME in ubuntu the same i used in windows ), realizing I have to download different for linux, i did and did path setting again.
ran eas build, and got error that android license not verified/not found ( something like that )
than I searching on web came on this page and found out as u said above: you need to install Android Studio ( Whole IDE ) in wsl.
----------------------------END-----------------------------------------------------------------
Also a few days ago, with many errors and somehow managing Java, Gradle, Kotlin versions to match each other, I somehow built a development build with Android Studio in Windows ( using npx expo run:android) . But the build process kinda took long, like 40 min, and on EAS server it takes like 15 min.
So my questions :
If I can make builds in Android Studio on windows, should still go for eas, ( if it takes lesser time for building or any other benefits, than i would like to use eas ) ?
Also is there any difference between build made from npx expo run:android and eas build ? thing is I tried to install the build made from android studio over the eas build ( the one from eas server ), normally it would simply update the app, but when I tried to install the one from android studio, it said : "App not installed because package conflicts with existing package", so i uninstalled existing app and and than installed the android studio build and it worked fine, got similar error when trying to install previous eas build over android studio build. maybe the credentials are different ?

@ananduremanan
Copy link

@OOCAZ , somehow I figured it out and as @crystalarcus said it takes a lot of time to build while in linux it takes only few minutes...

@crystalarcus
Copy link

crystalarcus commented Jan 2, 2024

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 :(

I guess you can build it in Android Studio too with npx expo run:android
from expo website:
image

ALSOO : npx expo run:android will make debug build ( development build ) of your app
to make a release build add a --variant release for android or --configuration Release for ios like:
npx expo run:android --variant release
image
You can check out on official website about local-app-development

Alsoo it can be a lil annoying to build it this way, ( i had hard time setting up correct java, kotlin and gradle versions ), idk what problems ios developers might face, eas does everything by itself, so it does feel a lil easy, still if building a android version on windows if what u want, Android Studio got your back !

Hope it helps !

@crystalarcus
Copy link

@OOCAZ , somehow I figured it out and as @crystalarcus said it takes a lot of time to build while in linux it takes only few minutes...

I'd start using Flutter at this point, its quite straight forward and well maintained, and a bit faster in performance due to it's 'Ahead-of-Time" (AOT) compilation. ( Also I like Material You Design )

@ananduremanan
Copy link

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

@crystalarcus
Copy link

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ?
also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

@ananduremanan
Copy link

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ? also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

I did it using the SDK tools without installing the Android studio on wsl, but the build got failed !!

@crystalarcus
Copy link

crystalarcus commented Jan 2, 2024

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ? also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

I did it using the SDK tools without installing the Android studio on wsl, but the build got failed !!

@ananduremanan so....u tried with Android Studio ? did it work ? cuz I am about to download it for linux

@OOCAZ
Copy link

OOCAZ commented Jan 3, 2024

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ? also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

I did it using the SDK tools without installing the Android studio on wsl, but the build got failed !!

@ananduremanan so....u tried with Android Studio ? did it work ? cuz I am about to download it for linux

Yeah I only ever got it working with Android Studio, the SDK tools never worked for me, but Android studio was working last I checked.

@crystalarcus
Copy link

crystalarcus commented Jan 4, 2024

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ? also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

I did it using the SDK tools without installing the Android studio on wsl, but the build got failed !!

@ananduremanan so....u tried with Android Studio ? did it work ? cuz I am about to download it for linux

Yeah I only ever got it working with Android Studio, the SDK tools never worked for me, but Android studio was working last I checked.

@OOCAZ I need help with this :
I installed Android Studio in Ubuntu, ran eas build -p android --profile development and things went well for 10 min, it was Gradle was running and than suddenly build failed with this :
The message received from the daemon indicates that the daemon has disappeared.
there was some output here -----

----- End of the daemon log -----

                                                                                                                 
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

from stackoverflow I found this solution, the answers said Deleting the daemon subfolder in /home/{username}/.gradle will fix the issue, but it didn't. Any suggestion ? ( I tried running it 5 to 6 times, even after restarting laptop, but same error ).

@OOCAZ
Copy link

OOCAZ commented Jan 4, 2024

@crystalarcus , Good choice, but flutter job market is so dull, idk why... Also, get linux, life will be amazing...

Oh btw, you said you figured it out, how to use EAS in wsl, did you do it using only android-sdk tools or did you downloaded whole android studio ? also if we have to download the android studio, did you ran eas build --local inside android studio terminal or does it works in direct ubuntu terminal too ?

I did it using the SDK tools without installing the Android studio on wsl, but the build got failed !!

@ananduremanan so....u tried with Android Studio ? did it work ? cuz I am about to download it for linux

Yeah I only ever got it working with Android Studio, the SDK tools never worked for me, but Android studio was working last I checked.

@OOCAZ I need help with this :
I installed Android Studio in Ubuntu, ran eas build -p android --profile development and things went well for 10 min, it was Gradle was running and than suddenly build failed with this :
The message received from the daemon indicates that the daemon has disappeared.
there was some output here -----

----- End of the daemon log -----

                                                                                                                 
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

from stackoverflow I found this solution, the answers said Deleting the daemon subfolder in /home/{username}/.gradle will fix the issue, but it didn't. Any suggestion ? ( I tried running it 5 to 6 times, even after restarting laptop, but same error ).

So I ran your command and it worked on the eas build systems. But I added the --local tag and it ran and built just fine for me. Are you still having the issue? Any chance you could try not doing a development build and just doing a default or production build? Let me know if that works.

@crystalarcus
Copy link

@OOCAZ I ran it for preview build as :
eas build -p android --profile preview
but it get stuck at
starting Daemon
while running gradlew
here is complete log :

Loaded "env" configuration for the "preview" profile: no environment variables specified. Learn more: https://docs.expo.dev/build-reference/variables/
Specified value for "android.package" in app.json is ignored because an android directory was detected in the project.
EAS Build will use the value found in the native code.
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials dOawfrwgrI (default)
✔ Compressed project files 16s (164 MB)
ANDROID_NDK_HOME environment variable was not specified, continuing build without NDK
[SETUP_WORKINGDIR] Preparing workingdir /tmp/crystalarcus/eas-build-local-nodejs/849b6556-08d0-4b10-8a27-a7b7637bab6c
[START_BUILD] Starting build
  "job": {
    "type": "generic",
    "platform": "android",
    "projectRootDirectory": ".",
    "projectArchive": {
      "type": "PATH",
      "path": "/tmp/crystalarcus/eas-cli-nodejs/89ab9a40-9b4f-46da-8136-e4145a2bc2aa.tar.gz"
    },
    "builderEnvironment": {},
    "cache": {
      "disabled": false,
      "paths": [],
      "clear": false
    },
    "updates": {},
    "buildType": "apk",
    "username": "crystalarcus",
    "experimental": {},
    "mode": "build",
    "triggeredBy": "EAS_CLI"
  }
[READ_PACKAGE_JSON] Using package.json:
[READ_PACKAGE_JSON] {
  "name": "mynotes",
  "version": "1.4.1",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "windows": "react-native run-windows"
  },
  "dependencies": {
    "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
    "@expo/config-plugins": "~7.2.2",
    "@expo/webpack-config": "^19.0.0",
    "@miblanchard/react-native-slider": "^2.3.1",
    "@pchmn/expo-material3-theme": "^1.3.1",
    "@react-native-assets/slider": "^7.0.5",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/cli-doctor": "^13.2.0",
    "@react-navigation/drawer": "^6.6.6",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "expo": "^49.0.21",
    "expo-asset": "~8.10.1",
    "expo-clipboard": "~4.3.1",
    "expo-dev-client": "~2.4.12",
    "expo-dynamic-app-icon": "^1.2.0",
    "expo-file-system": "~15.4.5",
    "expo-font": "~11.4.0",
    "expo-print": "~12.4.2",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "lodash": "^4.17.21",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-pager-view": "6.2.0",
    "react-native-paper": "^5.11.1",
    "react-native-paper-dates": "^0.20.5",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-share": "^10.0.2",
    "react-native-slider": "^0.11.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^10.0.3",
    "react-native-web": "~0.19.6",
    "react-native-windows": "0.72.21"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "metro-config": "^0.76.8",
    "sharp-cli": "^4.2.0"
  },
  "private": true
}
[INSTALL_DEPENDENCIES] Running "yarn install" in /tmp/crystalarcus/eas-build-local-nodejs/849b6556-08d0-4b10-8a27-a7b7637bab6c/build directory
[INSTALL_DEPENDENCIES] yarn install v1.22.21
[INSTALL_DEPENDENCIES] [1/4] Resolving packages...
[INSTALL_DEPENDENCIES] [2/4] Fetching packages...
[INSTALL_DEPENDENCIES] [3/4] Linking dependencies...
[INSTALL_DEPENDENCIES] warning "expo-splash-screen > @expo/prebuild-config@6.2.6" has unmet peer dependency "expo-modules-autolinking@>=0.8.1".
[INSTALL_DEPENDENCIES] warning "react-native > @react-native/codegen@0.72.7" has unmet peer dependency "@babel/preset-env@^7.1.6".
[INSTALL_DEPENDENCIES] warning "react-native > @react-native/codegen > jscodeshift@0.14.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
[INSTALL_DEPENDENCIES] warning " > react-native-push-notification@8.1.1" has unmet peer dependency "@react-native-community/push-notification-ios@^1.10.1".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-proposal-optional-chaining@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-arrow-functions@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-shorthand-properties@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-template-literals@^7.0.0-0".
[INSTALL_DEPENDENCIES] [4/4] Building fresh packages...
[INSTALL_DEPENDENCIES] Done in 25.16s.
The NODE_ENV environment variable is required but was not specified. Ensure the project is bundled with Expo CLI or NODE_ENV is set.
Proceeding without mode-specific .env
[READ_APP_CONFIG] Using app configuration:
[READ_APP_CONFIG] {
  "name": "My Notes",
  "slug": "MyNotes",
  "version": "1.4.1",
  "orientation": "portrait",
  "icon": "./assets/gicon.png",
  "userInterfaceStyle": "automatic",
  "splash": {
    "image": "./assets/gsplash.png",
    "resizeMode": "contain",
    "backgroundColor": "#ffffff"
  },
  "assetBundlePatterns": [
    "**/*"
  ],
  "ios": {
    "supportsTablet": true
  },
  "android": {
    "adaptiveIcon": {
      "foregroundImage": "./assets/gicon.png",
      "backgroundColor": "#ffffff",
      "monochromeImage": "./assets/giconmono.png"
    },
    "package": "com.crystalarcus.MyNotes"
  },
  "web": {
    "favicon": "./assets/favicon.png"
  },
  "extra": {
    "eas": {
      "projectId": "2183d8dc-92a6-47f1-af0a-c40813dd869e"
    }
  },
  "sdkVersion": "49.0.0",
  "platforms": [
    "ios",
    "android",
    "web"
  ]
}
[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] Running 10 checks on your project...
[RUN_EXPO_DOCTOR] ✔ Check Expo config for common issues
[RUN_EXPO_DOCTOR] ✔ Check package.json for common issues
[RUN_EXPO_DOCTOR] ✔ Check dependencies for packages that should not be installed directly
[RUN_EXPO_DOCTOR] ✔ Check for common project setup issues
[RUN_EXPO_DOCTOR] ✔ Check npm/ yarn versions
[RUN_EXPO_DOCTOR] ✔ Check Expo config (app.json/ app.config.js) schema
[RUN_EXPO_DOCTOR] ✔ Check that packages match versions required by installed Expo SDK
[RUN_EXPO_DOCTOR] ✔ Check for legacy global CLI installed locally
[RUN_EXPO_DOCTOR] ✔ Check that native modules do not use incompatible support packages
[RUN_EXPO_DOCTOR] ✔ Check that native modules use compatible support package versions for installed Expo SDK
[RUN_EXPO_DOCTOR] Didn't find any issues with the project!
[PREBUILD] Skipped running "expo prebuild" because the "android" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[RUN_GRADLEW] Running 'gradlew :app:assembleRelease' in /tmp/crystalarcus/eas-build-local-nodejs/849b6556-08d0-4b10-8a27-a7b7637bab6c/build/android
[RUN_GRADLEW] Downloading file:/tmp/crystalarcus/eas-build-local-nodejs/849b6556-08d0-4b10-8a27-a7b7637bab6c/build/android/gradle/wrapper/gradle-8.0.1-all.zip
[RUN_GRADLEW] 10
[RUN_GRADLEW] %.
[RUN_GRADLEW] 20%
[RUN_GRADLEW] 30
[RUN_GRADLEW] %.
[RUN_GRADLEW] 40%.
[RUN_GRADLEW] 50%.
[RUN_GRADLEW] 60%.
[RUN_GRADLEW] 70%.
[RUN_GRADLEW] 80%.
[RUN_GRADLEW] 90%.
[RUN_GRADLEW] 100%
[RUN_GRADLEW] Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

and it was stuck there for 30 min untill I ended with ctrl+c.
did it a few times still same.

@OOCAZ
Copy link

OOCAZ commented Jan 5, 2024

@crystalarcus The error appears to be this in particular: ANDROID_NDK_HOME environment variable was not specified, continuing build without NDK It looks like you may have not set the Android Home Variable or completely installed Android Studio, feel free to check around, send some screenshots and we will try to get to the bottom of this.

@crystalarcus
Copy link

crystalarcus commented Jan 6, 2024

@OOCAZ hello there, so I tried running today with same command but got following error :
complete log:

crystalarcus@crystalpc/mnt/c/Files/ReactNative/MyNotes$ eas build -p android --profile preview --local
Found eas-cli in your project dependencies.
It's recommended to use the "cli.version" field in eas.json to enforce the eas-cli version for your project.
Learn more: https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project

Found eas-cli in your project dependencies.
It's recommended to use the "cli.version" field in eas.json to enforce the eas-cli version for your project.
Learn more: https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project

Found eas-cli in your project dependencies.
It's recommended to use the "cli.version" field in eas.json to enforce the eas-cli version for your project.
Learn more: https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project

Loaded "env" configuration for the "preview" profile: no environment variables specified. Learn more: https://docs.expo.dev/build-reference/variables/
Specified value for "android.package" in app.json is ignored because an android directory was detected in the project.
EAS Build will use the value found in the native code.
✔ Using remote Android credentials (Expo server)
✔ Using Keystore from configuration: Build Credentials dOawfrwgrI (default)
✔ Compressed project files 7s (6.2 MB)
[SETUP_WORKINGDIR] Preparing workingdir /tmp/crystalarcus/eas-build-local-nodejs/ca299b0d-5354-437b-94a9-b8f0dee604f4
[START_BUILD] Starting build
  "job": {
    "type": "generic",
    "platform": "android",
    "projectRootDirectory": ".",
    "projectArchive": {
      "type": "PATH",
      "path": "/tmp/crystalarcus/eas-cli-nodejs/04f83084-eb82-49f1-8ce2-89bda4461d48.tar.gz"
    },
    "builderEnvironment": {},
    "cache": {
      "disabled": false,
      "paths": [],
      "clear": false
    },
    "updates": {},
    "buildType": "apk",
    "username": "crystalarcus",
    "experimental": {},
    "mode": "build",
    "triggeredBy": "EAS_CLI"
  }
[READ_PACKAGE_JSON] Using package.json:
[READ_PACKAGE_JSON] {
  "name": "mynotes",
  "version": "1.4.2",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "windows": "react-native run-windows"
  },
  "dependencies": {
    "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
    "@expo/config-plugins": "~7.2.2",
    "@expo/webpack-config": "^19.0.0",
    "@miblanchard/react-native-slider": "^2.3.1",
    "@pchmn/expo-material3-theme": "^1.3.1",
    "@react-native-assets/slider": "^7.0.5",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/cli-doctor": "^13.2.0",
    "@react-navigation/drawer": "^6.6.6",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@react-navigation/stack": "^6.3.20",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eas-cli": "^5.9.3",
    "expo": "^49.0.21",
    "expo-asset": "~8.10.1",
    "expo-clipboard": "~4.3.1",
    "expo-dev-client": "~2.4.12",
    "expo-dynamic-app-icon": "^1.2.0",
    "expo-file-system": "~15.4.5",
    "expo-font": "~11.4.0",
    "expo-print": "~12.4.2",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "lodash": "^4.17.21",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-pager-view": "6.2.0",
    "react-native-paper": "^5.11.1",
    "react-native-paper-dates": "^0.20.5",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-share": "^10.0.2",
    "react-native-slider": "^0.11.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-theme-switch-animation": "^0.6.0",
    "react-native-vector-icons": "^10.0.3",
    "react-native-web": "~0.19.6",
    "react-native-windows": "0.72.21"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "metro-config": "^0.76.8",
    "sharp-cli": "^2.1.0"
  },
  "private": true
}
[INSTALL_DEPENDENCIES] Running "yarn install" in /tmp/crystalarcus/eas-build-local-nodejs/ca299b0d-5354-437b-94a9-b8f0dee604f4/build directory
[INSTALL_DEPENDENCIES] yarn install v1.22.21
[INSTALL_DEPENDENCIES] [1/4] Resolving packages...
[INSTALL_DEPENDENCIES] [2/4] Fetching packages...
[INSTALL_DEPENDENCIES] warning multiyargs@1.0.0: The engine "yargs" appears to be invalid.
[INSTALL_DEPENDENCIES] [3/4] Linking dependencies...
[INSTALL_DEPENDENCIES] warning "eas-cli > @expo/prebuild-config@6.2.5" has unmet peer dependency "expo-modules-autolinking@>=0.8.1".
[INSTALL_DEPENDENCIES] warning "eas-cli > @expo/plugin-help > @oclif/core > ts-node@10.9.2" has unmet peer dependency "@types/node@*".
[INSTALL_DEPENDENCIES] warning "eas-cli > @expo/plugin-help > @oclif/core > ts-node@10.9.2" has unmet peer dependency "typescript@>=2.7".
[INSTALL_DEPENDENCIES] warning "expo-splash-screen > @expo/prebuild-config@6.2.6" has unmet peer dependency "expo-modules-autolinking@>=0.8.1".
[INSTALL_DEPENDENCIES] warning "react-native > @react-native/codegen@0.72.7" has unmet peer dependency "@babel/preset-env@^7.1.6".
[INSTALL_DEPENDENCIES] warning "react-native > @react-native/codegen > jscodeshift@0.14.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
[INSTALL_DEPENDENCIES] warning " > react-native-push-notification@8.1.1" has unmet peer dependency "@react-native-community/push-notification-ios@^1.10.1".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-proposal-optional-chaining@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-arrow-functions@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-shorthand-properties@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning " > react-native-reanimated@3.3.0" has unmet peer dependency "@babel/plugin-transform-template-literals@^7.0.0-0".
[INSTALL_DEPENDENCIES] warning Workspaces can only be enabled in private projects.
[INSTALL_DEPENDENCIES] [4/4] Building fresh packages...
[INSTALL_DEPENDENCIES] Done in 71.65s.
The NODE_ENV environment variable is required but was not specified. Ensure the project is bundled with Expo CLI or NODE_ENV is set.
Proceeding without mode-specific .env
[READ_APP_CONFIG] Using app configuration:
[READ_APP_CONFIG] {
  "name": "My Notes",
  "slug": "MyNotes",
  "version": "1.4.2",
  "orientation": "portrait",
  "icon": "./assets/gicon.png",
  "userInterfaceStyle": "automatic",
  "splash": {
    "image": "./assets/gsplash.png",
    "resizeMode": "contain",
    "backgroundColor": "#ffffff"
  },
  "assetBundlePatterns": [
    "**/*"
  ],
  "ios": {
    "supportsTablet": true
  },
  "android": {
    "adaptiveIcon": {
      "foregroundImage": "./assets/gicon.png",
      "backgroundColor": "#ffffff",
      "monochromeImage": "./assets/giconmono.png"
    },
    "package": "com.crystalarcus.MyNotes"
  },
  "web": {
    "favicon": "./assets/favicon.png"
  },
  "extra": {
    "eas": {
      "projectId": "2183d8dc-92a6-47f1-af0a-c40813dd869e"
    }
  },
  "sdkVersion": "49.0.0",
  "platforms": [
    "ios",
    "android",
    "web"
  ]
}
[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] Running 10 checks on your project...
[RUN_EXPO_DOCTOR] ✔ Check Expo config for common issues
[RUN_EXPO_DOCTOR] ✔ Check package.json for common issues
[RUN_EXPO_DOCTOR] ✔ Check dependencies for packages that should not be installed directly
[RUN_EXPO_DOCTOR] ✔ Check for common project setup issues
[RUN_EXPO_DOCTOR] ✔ Check npm/ yarn versions
[RUN_EXPO_DOCTOR] ✔ Check Expo config (app.json/ app.config.js) schema
[RUN_EXPO_DOCTOR] ✔ Check that packages match versions required by installed Expo SDK
[RUN_EXPO_DOCTOR] ✔ Check for legacy global CLI installed locally
[RUN_EXPO_DOCTOR] ✔ Check that native modules do not use incompatible support packages
[RUN_EXPO_DOCTOR] ✔ Check that native modules use compatible support package versions for installed Expo SDK
[RUN_EXPO_DOCTOR] Didn't find any issues with the project!
[PREBUILD] Skipped running "expo prebuild" because the "android" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[RUN_GRADLEW] Running 'gradlew :app:assembleRelease' in /tmp/crystalarcus/eas-build-local-nodejs/ca299b0d-5354-437b-94a9-b8f0dee604f4/build/android
[RUN_GRADLEW] Starting a Gradle Daemon (subsequent builds will be faster)
[RUN_GRADLEW] > Task :gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:compileJava
[RUN_GRADLEW] NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:jar
[RUN_GRADLEW] > Task :gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Configure project :app
[RUN_GRADLEW]  ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@2.4.14)
[RUN_GRADLEW] > Configure project :expo
[RUN_GRADLEW] Using expo modules
[RUN_GRADLEW] - pchmn-expo-material3-theme (1.3.1)
[RUN_GRADLEW]   - expo-application (5.3.1)
[RUN_GRADLEW]   - expo-clipboard (4.3.1)
[RUN_GRADLEW]   - expo-constants (14.4.2)
[RUN_GRADLEW]   - expo-dev-client (2.4.12)
[RUN_GRADLEW]   - expo-dev-launcher (2.4.14)
[RUN_GRADLEW]   - expo-dev-menu (3.2.2)
[RUN_GRADLEW]   - expo-dynamic-app-icon (1.2.0)
[RUN_GRADLEW] - expo-file-system (15.4.5)
[RUN_GRADLEW]   - expo-font (11.4.0)
[RUN_GRADLEW]   - expo-json-utils (0.7.1)
[RUN_GRADLEW]   - expo-keep-awake (12.3.0)
[RUN_GRADLEW]   - expo-manifests (0.7.2)
[RUN_GRADLEW]   - expo-modules-core (1.5.12)
[RUN_GRADLEW]   - expo-modules-core$android-annotation (1.5.12)
[RUN_GRADLEW]   - expo-modules-core$android-annotation-processor (1.5.12)
[RUN_GRADLEW]   - expo-print (12.4.2)
[RUN_GRADLEW]   - expo-sharing (11.5.0)
[RUN_GRADLEW]   - expo-splash-screen (0.20.5)
[RUN_GRADLEW] > Configure project :react-native-reanimated
[RUN_GRADLEW] No AAR for react-native-reanimated found. Attempting to build from source.
[RUN_GRADLEW] Android gradle plugin: 7.4.2
[RUN_GRADLEW] Gradle: 8.0.1
[RUN_GRADLEW] WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
[RUN_GRADLEW] The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. 
[RUN_GRADLEW] This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
[RUN_GRADLEW] Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
[RUN_GRADLEW] If the parent project does not need the plugin, add 'apply false' to the plugin line.
[RUN_GRADLEW] See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
[RUN_GRADLEW] The Kotlin plugin was loaded in the following projects: ':expo', ':expo-modules-core', ':react-native-gesture-handler', ':react-native-pager-view', ...
[RUN_GRADLEW] The message received from the daemon indicates that the daemon has disappeared.
[RUN_GRADLEW] Build request sent: Build{id=f49c85ad-c36c-4411-a0ff-8327c41f6b7c, currentDir=/tmp/crystalarcus/eas-build-local-nodejs/ca299b0d-5354-437b-94a9-b8f0dee604f4/build/android}
[RUN_GRADLEW] Attempting to read last messages from the daemon log...
[RUN_GRADLEW] Daemon pid: 2137
[RUN_GRADLEW]   log file: /home/crystalarcus/.gradle/daemon/8.0.1/daemon-2137.out.log
[RUN_GRADLEW] ----- Last  20 lines from daemon log file - daemon-2137.out.log -----
[RUN_GRADLEW]   - expo-keep-awake (12.3.0)
[RUN_GRADLEW]   - expo-manifests (0.7.2)
[RUN_GRADLEW]   - expo-modules-core (1.5.12)
[RUN_GRADLEW]   - expo-modules-core$android-annotation (1.5.12)
[RUN_GRADLEW]   - expo-modules-core$android-annotation-processor (1.5.12)
[RUN_GRADLEW]   - expo-print (12.4.2)
[RUN_GRADLEW]   - expo-sharing (11.5.0)
[RUN_GRADLEW]   - expo-splash-screen (0.20.5)
[RUN_GRADLEW] No AAR for react-native-reanimated found. Attempting to build from source.
[RUN_GRADLEW] Android gradle plugin: 7.4.2
[RUN_GRADLEW] Gradle: 8.0.1
[RUN_GRADLEW] WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
[RUN_GRADLEW] The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. 
[RUN_GRADLEW] This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
[RUN_GRADLEW] Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
[RUN_GRADLEW] If the parent project does not need the plugin, add 'apply false' to the plugin line.
[RUN_GRADLEW] See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
[RUN_GRADLEW] The Kotlin plugin was loaded in the following projects: ':expo', ':expo-modules-core', ':react-native-gesture-handler', ':react-native-pager-view', ...
[RUN_GRADLEW] ----- End of the daemon log -----
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1
    Error: build command failed.
Cystalarcus@crystalpc:/mnt/c/Files/ReactNative/MyNotes$ 

@rafi16jan
Copy link

You guys should use this docker image

https://github.com/hmerritt/android-sdk

@diazsasak
Copy link

@rafi16jan not working here :(

image

@rafi16jan
Copy link

@rafi16jan not working here :(

image

Try adding this on your package.json and run the script:
Screen Shot 2024-05-03 at 21 22 17

@angelopedroso
Copy link

My problem is build freezing in random tasks 👎

@angelopedroso
Copy link

angelopedroso commented May 22, 2024

My problem is build freezing in random tasks 👎

Ok, let's go. I FIGURE OUT A DEFINITELY SOLUTION.

Before all, follow these steps:
https://halimsamy.com/wsl-for-developers-installing-the-android-sdk

Note: Install java version 17+ instead of 8

Did it, you may proceed

  1. Go to your root java folder in WSL (ex.: /usr/lib/jvm/java-17-openjdk-amd64/bin/)

Note: I recommend use a JDK version 17+

  1. Run this code:
sudo keytool -genkey -v -keystore your-upload-key.keystore -alias your-key-alias -keyalg RSA -keysize 2048 -validity 10000
  1. Fill the formulary (save your password)

  2. Place the your-upload-key.keystore file under the android/app directory in your project folder.

  3. Edit the file ~/.gradle/gradle.properties, and add the following (replace ***** with the correct keystore password, alias and key password):

MYAPP_UPLOAD_STORE_FILE=your-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=your-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=*****
MYAPP_UPLOAD_KEY_PASSWORD=*****
  1. Edit the file android/app/build.gradle in your project folder, and add the signing config,
...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
    splits {
        abi {
            reset()
            enable true
            universalApk true
            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
    }
}
...
  1. Build application

7.1. To generate an AAB file run the code:

npx react-native build-android --mode=release

7.2. To generate an APK file, go to android folder and run the code:

./gradlew assembleRelease

Possible errors

Build freezing

  1. Create a file called .wslconfig at the root of the user - C:\Users\YourUsername\.wslconfig
  2. Paste this code inside
[wsl2]
memory=5GB
  1. Shutdown your WSL.
wsl --shutdown
  1. Relaunch your WSL

  2. That's it!

@marius-haugan
Copy link

The docs really should be improved to highlight the fact that you can not do eas build --local from Windows!

Skjermbilde 2024-06-06 095623

@crystalarcus
Copy link

crystalarcus commented Jun 6, 2024

The docs really should be improved

@marius-haugan They quite should, but why does it matter, just running command eas build --local will show you in terminal that only Linux or Mac is supported. Plus you get to make 30 builds per month / account on server, which i think is better than making locals cuz you can directly download and run in any device from anywhere, you can just make eas build from another account if you run outta limit.......wait this isn't illegal to say here is it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests