I'm building a react native project using expo. I'm on windows, so I enable WSL and install ubuntu from the microsoft store. Next I run expo build:android. I get the following error,
Your project must have an Android package set in app.json.
So I looked at expos tutorial page and it says to add,
"android": {
"package": "com.yourcompany.yourappname"
}
I add that to the app.json
file and I get the same error. I don't have the slightest idea as to why the error wont go away, because I've looked at the tutorial page and at my code, and I clearly have all the required fields.
This is the tutorial page I've been looking at : https://docs.expo.io/versions/latest/distribution/building-standalone-apps/
Anyways, this is my app.json file,
{
"expo": {
"name": "First React App",
"slug": "FirstReactNativeApp",
"privacy": "public",
"sdkVersion": "35.0.0",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"ios": {
"bundleIdentifier": "com.yourcompany.yourappname",
"supportsTablet": true,
},
"android": {
"package": "com.yourcompany.yourappname",
},
"platforms": [
"ios",
"android",
"web"
],
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
}
}
I just arrived here after experiencing the same problem. Turns out my app.config.js
wasn't passing on configuration from app.json
.
I fixed it by changing:
export default {
extra: {
[...]
},
};
to:
export default ({config}) => {
return Object.assign(config,
{
extra: {
[...]
}
});
};
For anyone coming to this page, add the following to your app.json.
"android": {
"package": "com.yourcompany.yourappname",
"versionCode": 1
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With