Skip to content

Instantly share code, notes, and snippets.

@paulschreiber
Last active May 14, 2024 19:06
Show Gist options
  • Save paulschreiber/84c1b3aa090247da11bf3ebc32b61769 to your computer and use it in GitHub Desktop.
Save paulschreiber/84c1b3aa090247da11bf3ebc32b61769 to your computer and use it in GitHub Desktop.
Making a dummy React Native app with Expo and Expo Prebuild

Create a React Native app

npx react-native@latest init foo

Install Expo

cd foo
npx install-expo-modules@latest

Set up prebuild

Instructions for prebuild.

Update your index.js file like so:

import {registerRootComponent} from 'expo';
import App from './App';
registerRootComponent(App);

Update your app.json file like so:

{
  "expo": {
    "name": "foo",
    "splash": {
      "backgroundColor": "#ffffff"
    },
    "android": {
      "package": "com.anonymous.foo"
    },
    "ios": {
      "bundleIdentifier": "com.anonymous.foo"
    }
  }
}

Adding splash fixes the splashscreen error:

AAPT: error: resource color/splashscreen_background (aka com.anonymous.foo:color/splashscreen_background) not found

Build the app

rm -rf android ios
npm install expo
npx expo prebuild --clean
npx expo run:android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment