Building an Android APK with React Native Expo | Tutorial EAS Build

Поділитися
Вставка
  • Опубліковано 26 січ 2025
  • Join us in this tutorial as we create an APK for Android.
    React Native Course 👉🏼 codewithbeto.d...
    For resources go to Code With Beto 👉🏼 codewithbeto.dev
    My new channel 👉🏼 / @codewithbeto1
    Join the Discord: / discord
    👨🏻‍💻 ☕️ 🌟 Would you like to support me? Sponsor me on GitHub🌟 ☕️ 👨🏻‍💻
    github.com/bet...
    ⭐️ If you want to learn more about me, check this links:
    Twitter: / betomoedano
    Instagram: / betomoedano. .
    Github: github.com/bet...
    Linkedin: / betomoedano
    Discord: / discord
    Code With Beto: codewithbeto.ve...
    Medium: / betomoedano01
    Figma: www.figma.com/...
    My channel in Spanish: / betomoedano
    ⭐️ My apps & projects:
    ► Code With Beto: codewithbeto.v...
    ► Eco Studios: ecodev.netlify...
    ⭐️ Contact: betomoedano@outlook.com

КОМЕНТАРІ • 128

  • @Krystian-i1o
    @Krystian-i1o Рік тому +5

    if it is crush after lounch then remove node modules and package-lock install packages using yarn and then during build check errors and in my case it was about add package react-native-screens

    • @testing0911
      @testing0911 Рік тому

      thanks buddy really needed this

    • @itznishantu
      @itznishantu 5 місяців тому +1

      Big Big thank you man . I really appreciate your comment . My app crashes after lunch but after deleting the node_module,packgae-lock and reinstalling them with the yarn solve the crashing problem. But while using yarn i have to install the missing packages manually and this is somthing annoying to me. But anyways thank you --> user-dm2kl7dw2h

    • @sarinan2459
      @sarinan2459 Місяць тому

      just posted a comment regarding this if people are experiencing the same thing. These comments also helped me!!

  • @MohammadMalash-w9b
    @MohammadMalash-w9b 2 місяці тому +2

    i have done every thing following the video and the docs, but after installing the app it remains at the start page that expo gives, io don't know what is the problem does any one solved it?

  • @lucasdossantosgomes8312
    @lucasdossantosgomes8312 Рік тому +10

    Build failed: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
    how to resolve this problem?

    • @my_extreme_code
      @my_extreme_code Рік тому +5

      When encountering a Gradle build failure with an unknown error, it can be challenging to pinpoint the exact cause without additional information or error logs. However, here are some general troubleshooting steps you can follow to resolve the issue:
      Check the error logs: Look for the specific error message or stack trace provided in the logs for the "Run gradlew" phase. The logs can usually be found in the console output or in a separate log file. Understanding the specific error message can help you identify the root cause of the problem.
      Verify Gradle version: Ensure that you are using a compatible Gradle version for your project. Check the Gradle documentation or the project's documentation to determine the recommended Gradle version. You can also try updating Gradle to a newer version if you are using an outdated one.
      Check for dependency conflicts: Gradle builds can fail due to conflicts between different dependencies. Use the dependency management features of Gradle to analyze and resolve any conflicts. You can try excluding or updating specific dependencies to resolve conflicts.
      Clean and rebuild: Sometimes, build failures can be caused by corrupt or outdated build artifacts. Try cleaning the project build by running gradlew clean or ./gradlew clean (depending on your operating system) before attempting to rebuild. This will remove any previously generated build files and start with a clean slate.
      Internet connectivity: Gradle relies on internet connectivity to download dependencies and plugins. Ensure that you have a stable internet connection and that any necessary proxies or firewalls are properly configured.
      Check for build script errors: Review your Gradle build scripts (build.gradle or build.gradle.kts) for any syntax errors or misconfigurations. Pay attention to the tasks, dependencies, and plugins specified in the build scripts.
      Gradle wrapper: If you are using the Gradle wrapper (gradlew or gradlew.bat), make sure it is properly configured and up to date. You can try updating the Gradle wrapper by running gradlew wrapper --gradle-version X.Y.Z (replace X.Y.Z with the desired Gradle version).
      Seek help: If you have tried the above steps and the issue persists, consider seeking help from the Gradle community or the specific project's support channels. They may be able to provide more targeted guidance based on the error logs or project-specific configuration.
      Remember to provide as much relevant information as possible when seeking assistance, such as the error message, relevant portions of the build script, and any additional context that might be helpful in diagnosing the problem.

  • @aryanbarnwal5645
    @aryanbarnwal5645 10 місяців тому +1

    can you please tell me if the APK file will run on my Android phone?

  • @KuldeepSahu-e9s
    @KuldeepSahu-e9s Рік тому +2

    I am getting error android build failed can you please resolve it ?

  • @sarinan2459
    @sarinan2459 Місяць тому

    Not sure if my previous comment got deleted, but here are my steps to how I fixed the APK file crashing when installing on physical device.
    Note: I used Expo SDK 51 and only built on Android for testing/school purposes.
    1. Delete node modules and package.lock (optional: I also deleted android folder)
    2. Run yarn install to download most dependencies, but some you will have to install manually such as these ones:
    - yarn add react-native-gesture-handler
    - yarn add react-native-reanimated
    - yarn add react-native-safe-area-context
    - yarn add react-native-screens
    - yarn add react-native-pager-view
    3. run npx expo-doctor to check if any dependencies are still missing or need to be updated
    4. I added my env variables to eas.json, not sure if you have to do this too but here is what mine looks like for Preview build
    "preview": {
    "distribution": "internal",
    "android": {
    "buildType": "apk"
    },
    "env": {
    "API_BASE_URL": ,
    // other env variables if you need to add
    }
    },
    5. then I run eas build:configure and eas build -p android --profile preview
    6. go to the EAS dev site to check your build, if it fails during run gradlew you can check the logs and see if any other dependencies are missing.
    Hope this helps.

    • @enochdollar-bill3306
      @enochdollar-bill3306 28 днів тому +1

      i have the problem. yet to try ur solution. but thanks for sharing man . helpful

    • @sarinan2459
      @sarinan2459 28 днів тому +1

      @enochdollar-bill3306 no problem, hopefully it works! Good luck

  • @MuteebAhmad-f9o
    @MuteebAhmad-f9o 26 днів тому

    getting this error "Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0."
    how can i come over this
    im using EXPO sdk 51 to make the build for my application

  • @OfirGormes-y2v
    @OfirGormes-y2v Рік тому +1

    Thanks for the useful video!
    Can you share how did you changed the app icon? I can't seem to change it no matter what I try.
    I changed it in the app.json file and ran eas update but the icon doesnt change.
    Help please🙏

  • @danielsalazar6557
    @danielsalazar6557 6 місяців тому +1

    Im having problems with asynstorage in the Apk when I install the file in my Android phone, for some reason the the asynstorage doesn't save any value, Did anyone have the same problem?

  • @victorhugotiradopenaranda3149
    @victorhugotiradopenaranda3149 Рік тому +1

    Linking local project to EAS project d7fc23b1-48ad-47da-a3ae-xxxxx3f7xxxx
    No config exists
    Error: build:configure command failed.

  • @sp-ef2fi
    @sp-ef2fi Рік тому +1

    So in Windows using EAS we can only target android simulator but not iOS?
    Then what is the benefit of using Expo over react native cli?

    • @codewithbeto
      @codewithbeto  Рік тому

      Yes you can target android, this tutorial is just for android

  • @Daniel-vc2nz
    @Daniel-vc2nz 6 місяців тому

    i couldn't explore more on the eas.json file and was not able to edit on it just like what you're doing on your screen but my eas build was successfully created for all device .what can i do ?

  • @javiersistemas
    @javiersistemas 2 роки тому +6

    Better English than some guys, Beto ... congrats 😀👍
    By the way, can you explain how to run and configure that Emulator on the right side on the screen, man. Thanks in advance 😀👍

    • @codewithbeto
      @codewithbeto  2 роки тому +1

      Thanks bro! Do you mean the IOS simulator? You just need to download Xcode 👍👍

    • @javiersistemas
      @javiersistemas 2 роки тому

      @@codewithbeto OK... in MacOS but in Windows is it possible? 🤔 I guess so. Thanks for your answer, my man 😀👍

    • @codewithbeto
      @codewithbeto  2 роки тому +1

      @@javiersistemas is not possible on windows

    • @javiersistemas
      @javiersistemas 2 роки тому

      @@codewithbeto ohhh boy 😨😨😨 ... that's so sad 😞 ... Anyway, thanks for your time, man and I'll keep supporting you, brother 😃😃

    • @codewithbeto
      @codewithbeto  2 роки тому +1

      @@javiersistemas thanks Javier I appreciate you

  • @patriciodiaz4483
    @patriciodiaz4483 11 місяців тому

    Hi! I have a question, how you configure the environment variables for development and production? I read the documentation and it says you have to pass them in thw eas.json file, but when I do it and build my preview android apk, it doesn't works

    • @sfallpeoplefaiz4473
      @sfallpeoplefaiz4473 10 місяців тому

      show me ur eas.json code

    • @wendigo6372
      @wendigo6372 6 місяців тому

      Did you solve it?

    • @patriciodiaz4483
      @patriciodiaz4483 6 місяців тому

      @@wendigo6372 yes I figured it out, I was able to set 3 environments, in my case development, preview and production. Also I found a way to change the App name depending of this one

    • @patriciodiaz4483
      @patriciodiaz4483 6 місяців тому

      {
      "cli": {
      "version": ">= 6.0.0"
      },
      "build": {
      "development": {
      "developmentClient": true,
      "distribution": "internal",
      "env": {
      "EXPO_PUBLIC_API_EXAMPLE": "",
      "EXPO_PUBLIC_API_EXAMPLE_2": ""
      },
      "android": {
      "buildType": "apk"
      }
      },
      "preview": {
      "distribution": "internal",
      "android": {
      "buildType": "apk"
      },
      "env": {
      "EXPO_PUBLIC_API_EXAMPLE": "",
      "EXPO_PUBLIC_API_EXAMPLE_2": "",
      "APP_VARIANT": "preview"
      }
      },
      "production": {
      "env": {
      "EXPO_PUBLIC_API_EXAMPLE": "",
      "EXPO_PUBLIC_API_NODO_EXAMPLE_2": ""
      },
      "android": {
      "buildType": "apk"
      }
      }
      },
      "submit": {
      "production": {}
      }
      }

    • @patriciodiaz4483
      @patriciodiaz4483 6 місяців тому

      That is the structure I use for eas.json. The important thing to set the correct prefix variable in env object, is a must to type the EXPO_PUBLIC_API_ . Another thing is the APP_VARIANT, is optional, but this will help you as a environment variable to be able to change some dynamic values (in my case de name of the app), I will comment an example

  • @anillimbu7092
    @anillimbu7092 Рік тому

    When i run this command in my terminal eas build:configure it says zsh: command not found: eas, how to fix it ?

    • @codewithbeto
      @codewithbeto  Рік тому

      You need to install the expo CLI, refer to the expo documentation for instructions 👍

  • @JuneBeforeJuly
    @JuneBeforeJuly Рік тому

    am i doing th enpm install in my project folder or do i do it through git?

  • @asmaakhaled9951
    @asmaakhaled9951 Рік тому

    I have a problem that the apk after build, and install it, the app crashed, it is open and close in the same moment, what is the problem?

  • @Lobos91
    @Lobos91 Рік тому

    There is 30 free builds a month in free plan, does it mean i can only run my app 30 times in visual code? That would be insane if there is 5 people working on app amd we daily open amd run it like 50 times

    • @awaisDeshmukh
      @awaisDeshmukh Рік тому +4

      As I understand it, it is not about running the app in Visual Studio Code, but rather about building it, which means that one can build the Android app up to 30 times and the iOS app up to 15 times. Trust me, I've run my own expo app more than 500 times in a month with Visual Studio Code. In other words, it's not about running an app, but about building an apk. I hope my response was helpful.

  • @pierremutamba5272
    @pierremutamba5272 Рік тому

    Hi, I can't create an account when I create it, I get an error message, can you help me, thank you for your answer. Peter

  • @michaellevi1474
    @michaellevi1474 Рік тому

    So, how do you pass the point with the node version problem? It seems like there's nothing I can do. It's literally the first problem, yet I can't seem to find a solution. How did you solve this?

    • @codewithbeto
      @codewithbeto  Рік тому

      Can you provide more context to this problem? I’m not sure what error you are referring

    • @michaellevi1474
      @michaellevi1474 Рік тому

      @@codewithbeto Sure. Expo doesn't support the LSV of Node, but not even the latest version, but the last 3 versions. I believe Node v16 and below are supported by Expo. Has something to do with Node using different hashing for security, I dunno. So my question is, is there a way around it? Or is the only way to downgrade node to version that supports Expo?

    • @codewithbeto
      @codewithbeto  Рік тому +1

      It should work with node 18 but you can try using a node version manager like nvm to quickly change between node versions in your computer. I hope this helps

  • @laurenceparcon5147
    @laurenceparcon5147 Рік тому

    "You have reached the concurrency limit. Build is waiting to enter the queue. "hello what is this error sir?

    • @Krystian-i1o
      @Krystian-i1o Рік тому

      you have to wait more for your build because another are in the queue

  • @Nibezak
    @Nibezak 2 роки тому +1

    mine is telling me android bundle failed , run "grandlew " 😭😭😭 please help me I need this

  • @elvinmucaj9664
    @elvinmucaj9664 Рік тому

    did you try to install into a android device? because I tried and comes with an error and I have to specify that I'm using windows OS

    • @arpanbajpai1226
      @arpanbajpai1226 Рік тому +1

      Did your app crashes as soon as you open your apk? And how to fix it.Plz help bro

    • @emirozdemir9060
      @emirozdemir9060 Рік тому +1

      @@arpanbajpai1226 I have the same issue... Did you find a solution?

    • @hudsonmenezesdev
      @hudsonmenezesdev Рік тому

      @@emirozdemir9060 any of you found a solution?

    • @tungac
      @tungac Рік тому

      my app crashing too when i start@@arpanbajpai1226

  • @pramudnadula9690
    @pramudnadula9690 Рік тому

    can you tell me what is the name of android simulator and where can i download

  • @sujanjoshi8151
    @sujanjoshi8151 Рік тому

    I get error with: Linking local project to EAS project

  • @conceptualdeveloper
    @conceptualdeveloper Рік тому

    IS it Debug apk? if yes then is it possible throught create-react-native-app?

  • @arpanbajpai1226
    @arpanbajpai1226 Рік тому

    Bro when i launch apk through my android phone it crashes and doesnt open what to do?

  • @EdikTVSet
    @EdikTVSet Рік тому

    My app works via Metro but it crashes after splash screen when I try to launch it via apk. 😭

    • @arpanbajpai1226
      @arpanbajpai1226 Рік тому

      Is your problem resolved?plz help me.

    • @EdikTVSet
      @EdikTVSet Рік тому +1

      @arpanbajpai1226 yep yep. I figured it out via creating a new project. In the new project I realized that I made some mistakes in previous project. For example, my way of installing packages was wrong. I used to installing packages using "npm install" but the right way is "npx expo install nameOfPackageYouWannaInstall"
      It was the main problem. Also, there were other problems with layout. I had some red errors but it worked via Metro. But unfortunately it doesn't work via apk. Make sure your project doesn't have errors.

    • @arpanbajpai1226
      @arpanbajpai1226 Рік тому

      @@EdikTVSet My project is almost error free.I am able to build and install the apk file in my physical android but as soon as i open it,it crashes and takes it to the Android interface.I dont know how to fix it.

    • @EdikTVSet
      @EdikTVSet Рік тому

      @arpanbajpai1226 try to create a new empty project. Then build it. Does it work? If so, great. Start adding new content step-by-step, build and test project. This way you will find the problem cuz one time you will get a wrong build. And you will know the reason why

    • @arpanbajpai1226
      @arpanbajpai1226 Рік тому

      @@EdikTVSet Ok bro I wanna this method may be it will work.Thnx

  • @anantgupta5806
    @anantgupta5806 9 місяців тому

    no worries for English bro, it's perfect

  • @Herowindows
    @Herowindows Рік тому

    apk crash everytime while open , what's the solution ??

  • @k1ll3trs86
    @k1ll3trs86 8 місяців тому

    That doesn't work anymore

  • @amanikafonogo9695
    @amanikafonogo9695 10 місяців тому

    I am getting eas not recognize command

  • @tonnykizito816
    @tonnykizito816 Рік тому

    The link generated for downloading apk is unreachable

    • @codewithbeto
      @codewithbeto  Рік тому

      Sometimes you just need to try again 😅

    • @tonnykizito816
      @tonnykizito816 Рік тому

      Ok, but I tried several times but still failed. Thank you for replying me

  • @CodeWithVakho
    @CodeWithVakho 3 місяці тому +1

    my apk opens and closes

    • @sarinan2459
      @sarinan2459 Місяць тому

      Check my comment that I just posted on this video if you are experiencing this still

  • @أميرالمؤمنينبنمحمدأكرم

    why the apk 60mb for only hello world

    • @shahbazimma
      @shahbazimma 4 місяці тому

      me to facing with same issue

    • @أميرالمؤمنينبنمحمدأكرم
      @أميرالمؤمنينبنمحمدأكرم 4 місяці тому

      @@shahbazimma now i understand, the size of the eas build is not the same as playstore build, in the playstore, it should be around 9-11 mb in the latest SDK

  • @ikerenson
    @ikerenson 10 місяців тому

    what about on windows?

  • @AnjanBoro-l4g
    @AnjanBoro-l4g Рік тому +1

    apk crash everytime while open

  • @echendukwe1510
    @echendukwe1510 Рік тому

    i get an AAB file instead of an apk, any help?

    • @wisdomelue
      @wisdomelue Рік тому

      add this to the "preview" object
      "android": {
      "buildType": "apk"
      }

  • @micahenoch7333
    @micahenoch7333 5 місяців тому

    please how can i add env file

  • @johncmm9759
    @johncmm9759 Рік тому

    Let us know if you publish the course in English! I'd buy in a heartbeat

    • @codewithbeto
      @codewithbeto  Рік тому

      The course is almost entirely available in English now! You can see the progres here codewithbeto.dev/learn

  • @abishaa6691
    @abishaa6691 Рік тому

    Thank you.🎉

  • @tonnykizito816
    @tonnykizito816 Рік тому

    The link generated for downloadingi

  • @Krystian-i1o
    @Krystian-i1o Рік тому

    how to build for ios?

  • @hendoitechnologies
    @hendoitechnologies 14 днів тому

    post React Native CLI Videos

  • @ItsMe-fj1co
    @ItsMe-fj1co Рік тому +1

    ver helpful, tu ver much!

  • @neelsoni13062
    @neelsoni13062 Рік тому

    Work this video😀😀😀😀

  • @bilelrahmouni01
    @bilelrahmouni01 Рік тому

    thank you

  • @OmSingh-ku5ms
    @OmSingh-ku5ms Рік тому

    bro english courses are very important

  • @alimosbah
    @alimosbah 2 роки тому +1

    English Bro English Plz Plz 😇😇😇😇😇😇😇

  • @JituKatroliya-l6w
    @JituKatroliya-l6w Місяць тому

    Hack

  • @emmanuelolaosebikan8211
    @emmanuelolaosebikan8211 6 місяців тому

    English or Spanish 😂

  • @SonuSinghmirzapur
    @SonuSinghmirzapur Рік тому +1

    Compressing project files :- failed to upload the project tarball to eas build.
    Reason :- cannot copy 'C:\Users\***' to a subdirectory of itself,
    Help ?

    • @satyamtripathi799
      @satyamtripathi799 7 місяців тому

      hi facing same issue
      can u let me know how u resolved it ?

  • @edcelguinto719
    @edcelguinto719 Рік тому

    i tried to build the app but upon installing in on an android device the app is stuck on the splash screen.

  • @Rabeet_CodeLab
    @Rabeet_CodeLab Рік тому +4

    When i install .apk file into android phone. it installs, but when i open it says 'app stops' and never start

    • @hudsonmenezesdev
      @hudsonmenezesdev Рік тому

      Mine too, did you fix it? How?

    • @tungac
      @tungac Рік тому

      how did you fix it?@@hudsonmenezesdev

    • @wisdomelue
      @wisdomelue Рік тому

      ​@@hudsonmenezesdevhappened to me, I had to check the build logs to figure it out, might be dependency issues or even the images you are using for icon, adaptive-icon etc
      specifically check the "expo run doctor" part of the build logs and also "run gradle"

    • @keithlunatic2266
      @keithlunatic2266 Рік тому +1

      It might be caused due to dependency issue, happened to me

    • @ТаалайбекУтуров
      @ТаалайбекУтуров 10 місяців тому

      Did you fix it?