Uploading app to Expo EAS and the Android and Ios builds keep failing in the preBuild phase - react-native

I have tried both android and Ios and for both the results are the same. everything is fine up until the preBuild stage. How can I correct this issue so that I can get a successful build? thanks
The images show the errors that I am getting.
Error Message
Error Message
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-notifications",
{
"icon": "./local/assets/notification-icon.png",
"color": "#ffffff",
"sounds": [
"./local/assets/notification-sound.wav",
"./local/assets/notification-sound-other.wav"
]
}
]
],

Related

Updates.channel is coming as null after setting up expo-updates

In my project I am using expo-sdk:43 along with expo-updates.
I have setup the channel property in eas.json file.
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel":"dev"
},
"preview": {
"android": {
"buildType": "apk"
},
"channel":"preview"
},
"production": {}
},
"submit": {
"production": {}
}
}
I have tried to publish my updates through EAS update, but it is not working and the app is not receiving any update. I have tried to do an apk build for the application, and tried to get the output of Updates.Channel and it is outputting as undefined.
eas build -p android --profile --preview
eas update --branch preview --message "update"
But, when I build the app, the build is successful, in the eas logs I can see that it shows that channel property has also been configured.
Can someone please help what might be the possible issue in this case?
I have also tried to do the same steps with an expo-init command (But with expo sdk:47) and minimal app setup and it is working as expected.

EAS updates not working possibly due to missing channel-name in Expo.plist

I'm trying to make EAS updates to work, after debugging, the issue seems to be the missing channel-name, which does not appear in Expo.plist, although,I believe, my eas.json is set up correctly.
I am not using anywhere in the app releaseChannel, replaced it with channel and I did rebuilt the app. Did anyone encounter this issue or knows a solution ? This is how I set the profile in eas.json:
“build”:{
"staging-1863": {
"channel": "staging-1863",
"env": {
"ENVIRONMENT": "staging"
},
"android": {
"buildType": "apk",
"credentialsSource": "local"
},
"ios": {
"credentialsSource": "local"
}
},
}

Error: "ios.bundleIdentifier" is not defined in your app.config.js and we can't update this file programmatically. Add the value

I am trying to deploy a React Native App using eas build.
The app builds successfully on Android but not on IOS.
I see this error message which says ios.bundleIdentifier is not defined in app.config.js
But... it IS defined, as can be seen here:
import 'dotenv/config';
export default {
"name": "raterepositoryapp",
extra: {
env: process.env.ENV,
uri: process.env.APOLLO_URI
},
"expo": {
"extra": {
"eas": {
"projectId": "ecf6c94b-c096-4a5b-ab41-8dfdd36de96b"
}
}
},
"slug": "rate-repository-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.webforprofessionals.rate-repository-app",
"buildNumber": "1.0.0"
},
"android": {
"package": "com.webforprofessionals.raterepositoryapp",
"versionCode": 1,
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
Why is the error coming up ?
I was able to finally discover the answer by using the EAS CLI command eas config --platform=ios --profile=preview (or whatever profile you want to test against). When you look at the output it gives you for app.config.js, you'll notice that there is no ios section shown and it's much smaller than your full app.config.js object. It is only using the eas portion of your app config.
I was able to fix the error by copying the ios config that's at the top-level of app.config.js into the expo portion of your config. I also moved the definition into a variable so I could use it in both places without repeating myself.
Edit:
After some more testing and documentation reading, I discovered what the real issue was. It appears that if you use app.config.js, the object you return is interpreted as the expo config... unless you also have an expo key inside that object. Then it only looks at what's in the expo part of your config. So what you really want to do is take your everything that's embedded under expo.extra and move it under extra.
Afterwards your app.config.js should look something like this:
export default {
name: "raterepositoryapp",
extra: {
env: process.env.ENV,
uri: process.env.APOLLO_URI,
eas: {
projectId: "ecf6c94b-c096-4a5b-ab41-8dfdd36de96b"
}
},
slug: "rate-repository-app",
// etc...
}
This is not obvious at all based on the error output, but after you realize which part of the file it's using, it's easy to address. I hope this works for you, too.
The documentation that tipped me off to this can be found here. You'll notice that wherever it uses the app.json format, you'll see everything nested under an expo key, but wherever it uses the app.config.js format, you'll see everything at the top-level of the object. That gave me the hint to start testing moving everything to the top level and do some testing.

React native Expo Build Number does not Increase

I am trying to build version "1.2.0" i have changed every single "buildNumber" and "version" in app.json and expo still builds ios buildNumber: "1.0.0". I am using
eas build --profile production --platform ios
{
"expo": {
"name": "Redacted",
"slug": "Redacted",
"description":"Redacted",
"version": "1.2.0",
"orientation": "portrait",
"icon": "./assets/mark.png",
"splash": {
"image": "./assets/TRANSPARENT2.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"buildNumber": "1.2",
"infoPlist": {
"NSFaceIDUsageDescription": "This app uses the FaceID feature to login. If faceID fails or if it is not available for any reason, the app will fall back to a standard login system."
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"permissions": [
"CAMERA",
"USE_FINGERPRINT",
"USE_BIOMETRIC",
"VIBRATE"
],
"package": "Redacted"
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-notifications",
{
"icon": "./assets/DarkVersion.png",
"color": "#d2282e",
"sounds": [
"./assets/notification.m4r"
]
}
]
]
}
}
This is what i get on expo.dev...I cant submit the app because of this.
And here is the error in the console.
Same Experience
I had a similar experience updating the app.json file in my-expo-project.
I kept the version string the same 0.9.9 and only changed the build number string from 124 to 125.
Running eas build --profile production --platform iOS resulted in the same console error.
You've already submitted this version of the app.
The build summary on expo.dev showed the old build number was delivered.
Solution
Turns out I had to use the expo prebuild command to resolve this.
➜ my-expo-project git:(v125) $ expo prebuild
✔ Created native projects | /android, /ios already created | gitignore already synced
✔ Updated package.json and added index.js entry point for iOS and Android
📦 Using npm to install packages.
✔ Cleaned JavaScript dependencies 3698ms
✔ Installed JavaScript dependencies 11150ms
✔ Config synced
Now that the app config is synced to the ./iOS and ./Android folders eas build --profile production --platform iOS now delivers the correct bundle and build number to expo.dev
Turns out eas build --profile production --platform ios does not update the plist file every time you run it (super lame IMO). You manually need to go into the ./ios/<yourApp>/plist file and update the CFBundleVersion and CFBundleShortVersionString keys. This is only a thing after your first run of eas build --profile production --platform ios
If you do not have any native code or have not updated native code inside the ios or android folder, you can delete the folders and let EAS handle the builds for you. Without those folders, eas build -p ios with or without --local will update the build numbers from the app.json file.
If you want to keep the ios and android folders, you'll have to run npx expo prebuild as #L4ivi suggested or you can update the version going into ios > info.plist file and update the string value of CFBundleShortVersionString for your version number and CFBundleVersion for your build number. Or you can open the .xcworkspace file to open the project in Xcode and update the version and build number there.

Ionic app doesn't hit on server when using capacitor

My Ionic app works fine when running with ionic serve but when i use the command ionic capacitor run android -l it doesn't hit on sever and gives error
Webpage not available: net::ERR_CONNECTION_REFUSED
I am using the latest Ionic version.
capacitor.config.json
{
"appId": "fire.app.flashlight",
"appName": "Flashlight",
"bundledWebRuntime": false,
"windowsAndroidStudioPath": "C:\\Users\\Digisoft\\Downloads\\Compressed\\android-studio-ide-201.6692364-windows\\android-studio\\bin\\studio64.exe",
"npmClient": "npm",
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
},
"cordova": {},
"server": {
"url": "http://localhost:8100",
"cleartext": true
}
}
Try to erase the "url" inside the "server"