10

I setup my app using create-react-native and I used expo's Video component in my app. How can I keep this video component and generate the apk file? Correct me if I'm wrong: to my understanding npm run eject prevents you from using expo components in the future. So how can I generate the apk file. It doesn't matter if it's signed or unsigned, atleast to me, I just want to email my friend the apk file so he can run it on his phone

Edit: This is not a duplicate of: How can I generate an apk that can run without server with react-native?

As that question asks how to generate an apk file for react-native, mine ask how this works with the specific create-react-native-app build where I am using an expo component

mdash1
  • 1,115
  • 4
  • 17
  • 31
  • 1
    Possible duplicate of [How can I generate an apk that can run without server with react-native?](https://stackoverflow.com/questions/35935060/how-can-i-generate-an-apk-that-can-run-without-server-with-react-native) – Mo'men Mohamed Aug 24 '17 at 00:14
  • @Mo'menMohamed I have edited my question to expand upon why this is not a duplicate and my specific needs with expo video component and create-react-native-app build – mdash1 Aug 24 '17 at 02:23
  • share the link to your friend using expo XDE https://docs.expo.io/versions/latest/introduction/installation.html – YaSh Chaudhary Aug 24 '17 at 04:59
  • 1
    maybe does this help https://facebook.github.io/react-native/docs/signed-apk-android.html – Varun Nath Sep 11 '17 at 14:28

4 Answers4

6
  1. Install npm install -g exp

  2. edit app.json file in our project

    {
    "expo": {
    "name":"my app",
    "icon":"./logo.png",
    "description":"some description about our project",
    "sdkVersion": "27.0.0",
    "android":{
         "package":"com.johncy.myapp",
          "versionCode":1 , 
          "icon":"./logo.png"
              }
             }
    }
    
  3. give the command in our project directory exp build:android

  4. Just wait for few mins.It will give an url for our build project.We can download *.apk file from that link.

Johncy
  • 504
  • 7
  • 12
5
  1. Install expo cli globally npm install -g exp
  2. Run exp build:android or exp build:ios inside the project
  3. Choose some expo options
  4. Wait few minutes

A build link should be printed in the terminal. For the next steps see this thread: Created an app with create-react-native-app, how to publish it to the Google Play Store?

Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
3

exp:build android exp:status to check the status of your apk

will generate a url for you to download the apk from

mdash1
  • 1,115
  • 4
  • 17
  • 31
2

Android App Bundle(AAB): expo build:android -t app-bundle

Android Apk: expo build:android -t apk