I’ve been making React Native apps using
npx create-react-native-app
and installing packages with
npm install
This seems to build and run on an emulator or physical just fine when running using Expo Go
yarn start
The problem seems to come when trying to create a native android build using
npm run android
This seems to get to about 91% complete before I get the following error:
> Task :expo-modules-core:buildCMakeDebug[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-modules-core:buildCMakeDebug[arm64-v8a]'.
> Expected output file at /home/huw/code/test-new/node_modules/expo-modules-core/android/build/intermediates/cxx/Debug/4b96w532/obj/arm64-v8a/libexpo-modules-core.so
for target expo-modules-core but there was none
My package.json is as follows:
{
"name": "test-new",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~51.0.14",
"expo-status-bar": "~1.12.1",
"react": "18.2.0",
"react-native": "0.74.2"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
I am running Linux Mint.
I have tried the solutions on here and elsewhere. Removing expo-modules-core and reinstalling seems to work for a lot of people, but I’ve tried running both of the following commands and attempting rebuild at each point:
npm install expo-modules-core
npm remove expo-modules-core
Same problems after both.
I have also tried running expo doctor
npx expo-doctor
with it saying it didn’t find any issues with the project.
I’ve also tried deleting everything and starting again several times. I also heard that long file paths can cause problems, so I have kept it as short as possible this time.
I would be very grateful to anyone who can help me solve this issue! Thanks in advance!