Why when I compile my app the status bar suddenly appear? When I'm testing it in the expo go app or in a android emulator you can't see the status bar but as soon as I build it with eas to an apk it appears and moves my whole app design down:
Here is my eas.json
{
"cli": {
"version": ">= 2.1.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"channel": "preview",
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {
"channel": "production"
}
},
"submit": {
"production": {}
}
}
.
And here is my app.config.js
export default
{
expo: {
name: "Campus Market",
description: "",
slug: "cmkt",
scheme: "campusmarket",
owner: "***",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
backgroundColor: "#f2f2f2",
primaryColor: "#72e292",
splash: {
image: "./assets/splash.png",
resizeMode: "contain",
backgroundColor: "#72e292"
},
updates: {
fallbackToCacheTimeout: 0,
url: "https://u.expo.dev/***",
},
runTimeVersion: {
policy: "sdkVersion",
},
jsEngine: "hermes",
assetBundlePatterns: [
"**/*"
],
ios: {
supportsTablet: false,
bundleIdentifier: "***",
},
android: {
package: "***",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#72e292"
},
permissions: [],
},
extra: {
eas: {
projectId: "***",
}
},
}
}
How do i get rid of it? :(
I'm using expo sdk 46, expo-cli 6.0.5 and eas 2.0.1
The problem was related with react navigation, not with expo nor eas.
I fixed it using the statusbar component from expo-status-bar in the screens:
<StatusBar translucent backgroundColor="transparent" />
Related
I'm having a problem with OTA updates from EXPO. Indeed, I have an application in which I have configured the updates via EAS and modified the app.json file in order to take the updates into account. Also I rebuilt the application and installed it. I try since, to make remote updates; unable to get the result of the update the application remains exactly the same.
This is my app.json:
{
"expo": {
"name": "xxxxxx",
"slug": "xxxxxx",
"version": "0.1.8",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/xxxxxx.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 300000,
"url": "https://u.expo.dev/8xxxxxxxxxxxxxxxxxxxxxxxxx"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.xxxxxx.xxxxxx",
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#FFFFFF"
},
"intentFilters": [
{
"action": "MAIN",
"data": {},
"category": [
"LEANBACK_LAUNCHER",
"LAUNCHER"
]
}
]
},
"androidNavigationBar": {
"visible": "sticky-immersive"
},
"androidStatusBar": {
"hidden": true
},
"web": {
"favicon": "./assets/logo-square.png"
},
"extra": {
"eas": {
"projectId": "8xxxxxxxxxxxxxxxxxxxxxxxx"
}
},
"runtimeVersion": {
"policy": "sdkVersion"
}
}
}
I've tried to modify the fallbackToCacheTimeout ... nothing. Also, i've tried to prebuild the app and put the version of the SDK in the app.json and AndroidManifest, nothing too.
Any ideas?
I am trying to change my default Splash screen in my Expo app with a new one.
I am using EAS profile development.
this is my app.json
{
"expo": {
"name": "blue-kiwi",
"slug": "blue-kiwi",
"version": "1.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"package": "com.basselturky.bluekiwi"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
I put my new splash.png in the assets folder but it keeps showing the default one.
I tried to rebuild but nothing worked.
I want to be able to change it whenever I want and the splash updates instantly.
Thank you in advance.
I am building an app with React Native and using Expo CLI. I am having a problem with missing assets once the app is built and testing on test flight. I am getting the error below. I have read through the documents on react native and expo and I cannot seem to figure out the problem. Also attached is my app.json and the metro.config.js files.
It looks like that you are using a custom metro.config.js that does not extend #expo/metro-config.
This can result in unexpected and hard to debug issues, like missing assets in the production bundle.
We recommend you to abort, fix the metro.config.js, and try again.
app.json
{
"expo": {
"name": "Unfiltered",
"slug": "unfiltered-with-kiran",
"version": "1.0.5",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "blahblahblah",
"buildNumber": "1"
},
"android": {
"versionCode": 2,
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"package": "blahblahblah"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig(__dirname);
return {
resolver: {
assetExts: [
...assetExts,
'png',
'jpg',
'jpeg',
'gif',
'svg',
'ttf',
'otf',
'woff',
'woff2',
],
sourceExts: [
...sourceExts,
'cjs',
'jsx',
'ts',
'tsx',
'mjs',
'md',
'mdx',
],
},
};
})();
I finally found the answer, I had to add the transformer and assetPlugins.
transformer: {
assetPlugins: ['expo-asset/tools/hashAssetFiles'],
},
When publishing my app with expo using expo publish or pushing the app to App Store and Play Store, I get a crash on launch of the production app on both iOS and Android plateform with the error :
Unhandled JS Exception: manifest must specify logUrl
As this error doesn't happened on Development app, I don't know how to debug this. Does anyone encounter the same issue ? Do you have any idea on what's going on or do you have any idea on a method to find the error ?
Just for more context, I did publish my app to both stores months ago without any issue. I did not change anything in my manifest except changing the Expo SDK from version 38 to 40. Here is my current manifest :
{
"expo": {
"name": "My App",
"slug": "myApp",
"privacy": "public",
"platforms": ["ios", "android"],
"version": "1.0.2",
"orientation": "portrait",
"backgroundColor": "#ffffff",
"primaryColor": "#7198FF",
"icon": "./assets/android-icon.png",
"splash": {
"image": "./assets/Launch_Screen.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": false,
"bundleIdentifier": "com.company.app",
"buildNumber": "1"
},
"android": {
"package": "com.company.app",
"googleServicesFile": "./google-services.json",
"permissions": [
"CAMERA",
"MANAGE_DOCUMENTS",
"READ_CONTACTS",
"READ_CALENDAR",
"WRITE_CALENDAR",
"READ_EXTERNAL_STORAGE",
"READ_PHONE_STATE",
"RECORD_AUDIO",
"USE_FINGERPRINT",
"VIBRATE"
],
"versionCode": 21
},
"androidNavigationBar": {
"visible": "sticky-immersive",
"barStyle": "dark-content",
"backgroundColor": "#FFFFFF"
},
"androidStatusBar": {
"hidden": false,
"translucent": true,
"barStyle": "dark-content",
"backgroundColor": "#FFFFFF"
},
"extra": {
"firebase": {
"apiKey": "FIREBASE_KEY",
"authDomain": "app.firebaseapp.com",
"databaseURL": "https://app.firebaseio.com",
"projectId": "app",
"storageBucket": "app.appspot.com",
"messagingSenderId": "SENDER_ID",
"appId": "1:appID",
"measurementId": "G-ID"
}
},
"web": {
"config": {
"firebase": {
"apiKey": "FIREBASE_KEY",
"authDomain": "app.firebaseapp.com",
"databaseURL": "https://app.firebaseio.com",
"projectId": "app",
"storageBucket": "app.appspot.com",
"messagingSenderId": "MESSEGING_ID",
"appId": "1:APP_ID:web:WEB_ID",
"measurementId": "G-ID"
}
}
},
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "app",
"project": "app",
"authToken": "SENTRY_TOKEN"
}
}
]
}
}
}
Seems like the issue was with expo trying to put logs to non-existent route on production.
According to expo docs,
the Expo SDK intercepts calls to console.log, console.warn, etc. and posts them to the logUrl specified in the manifest.
Check if you have Logs.enableExpoCliLogging(); enabled? Or if not, try manually importing logs at entry point
import { Logs } from 'expo';
and manually disabling them
Logs.disableExpoCliLogging();
According to the OP comment, the issue was as i mentioned. This stack helped me tho.
After reading #Oleksii comment about checking if the Expo CLI logging where enabled with Logs.enableExpoCliLogging();, it seems that this was causing the issue.
Just disable those by importing import { Logs } from 'expo'; and then calling Logs.disableExpoCliLogging(); in the app entry point file make it works again in production environment !
Thanks again #Oleksii !
i have problem with expo standalone app. the problem is with the ask permissions for locations. in the development mode, app asks for location permissions and works well. there is no bugs. after build the app using
expo build:android
it creates a android standalone app. and after installing that APK and try to access the same page that asks for location permissions, the app is crashed and restarted.
i added the permissions to app.json, but it not works. development mode, everything works fine.
app.json
"expo": {
"name": "AS APP",
"slug": "as_app",
"privacy": "public",
"sdkVersion": "32.0.0",
"android": {
"package": "com.xxx.asapp",
"icon": "./assets/icon.png",
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
"CAMERA",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
]
},
"platforms": [
"ios",
"android"
],
"version": "1.10",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#781D7D"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.xxx.asapp"
},
"description": "",
}
ask for location permissions
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if(this.state.isMounted){
if (status !== 'granted') {
Alert.alert(
'Permissions',
'please grant your permissions to access your location!',
[
{text: 'Ok', onPress: () => {
const popAction = StackActions.pop({n: 1});
this.props.navigation.dispatch(popAction);
}}
],
{cancelable: false},
);
}else{
let myLocation = await Location.getCurrentPositionAsync({
enableHighAccuracy: true,
});
let direction = await Location.geocodeAsync(this.props.navigation.getParam('address',null));
let myLocationAddress = await Location.reverseGeocodeAsync({
latitude: myLocation.coords.latitude,
longitude: myLocation.coords.longitude,
});
this.setState({
coordinates: [
{
latitude: myLocation.coords.latitude,
longitude: myLocation.coords.longitude
},
{
latitude: direction[0].latitude,
longitude: direction[0].longitude
},
],
myAddress: myLocationAddress
})
}
}
anyone can resolve this, please help me!
Upgrade your expo cli and expo sdk or downgrade if its too new