Create a development build for Android with Expo
In some cases, it is necessary to create a native development build. For example, when working with libraries whose functionality relies on native system functions, such as the react-native-app-auth library .
A native development build is more time-consuming but, in my opinion, necessary in advanced development processes, as at some point Expo with its hybrid development is no longer sufficient.
In Android, Expo can be used to create the development build in two ways:
- Using an emulator directly on the PC (e.g. using these instructions)
- On a physical device connected via USB
For method 2, USB debugging and Installation via USB must be enabled in the developer settings on the device. This is a feature that should be used with extreme caution and is best disabled again after testing.
Prerequisites
- A connected device using one of the methods described above
- A workspace configured with Expo / Expo CLI installed
(done if the project was created like this:
npx create-expo-app@latest) - To create the build, I need Java JDK v17 for Expo v54; this may be different for others.
From my own experience, I recommend creating the project folder
as high up in the folder hierarchy as possible,
e.g. C:\GitHub\<your-expo-app>
This prevents path length errors in the build process, which can be very annoying as they often occur shortly before the end of the process, often after 5-10 minutes.
The sample error message looks like this for me:
ninja: error: Stat(safeareacontext_autolinked_build/CMakeFiles/react_codegen_safeareacontext.dir/C_/Users/testuser/Documents/GitHub/expo-app/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp.o): Filename longer than 260 characters
Create the development build
Create native Android build
To create the development build for Android, you must first enter this command in the terminal,
which creates the native build folder in the root (your-expo-app/.android) directory:
npx expo prebuildConfiguring native build settings
After creating the build folder, I currently need to specify the paths of the Java JDK and Android SDK installed above so that Expo knows
- that it is being used, and
- the path to it
We achieve this as follows:
Edit .android/gradle.properties
Open the .android/gradle.properties file and add the following lines at the end of the file:
# Path to the JDK installation on windows
org.gradle.java.home=C:\\Users\\<your user>\\AppData\\Local\\Programs\\Microsoft\\jdk-17.0.17.10-hotspotThis line is required by the Android Gradle Plugin to locate the JDK.
Create local.properties file
Create the local.properties file in the .android folder with the following content:
sdk.dir=C:\\Users\\<your user>\\AppData\\Local\\Android\\SdkThis file is required by the Android Gradle Plugin to locate your Android SDK.
Start the development build
Once everything has been configured, the development build can now be started. This may take some time depending on the hardware performance and size/scope of the app. To do this, enter the following command in the terminal:
npx expo run:androidIf the build was successful, the Expo overview should open in the same terminal window, and the dev build will be installed on the emulator or connected device and open automatically.
Created: 02.12.2025
Last Updated: 02.12.2025