I'm trying to update expo sdk from 46 to 49 and when I update all the packages I faced a problem related to expo-updates
package
in the application I'm using RTL with a default language ar
so I need to reload application if RTL is false for the first time or when user change the language.
the problem is when running the application on Expo Go
for the first time this error appears
WARN [Error: You cannot use the Updates module in development mode in a production app. To test manual updates, publish your project using `expo publish` and open the published version in this development client.]
and when I try to generate a standalone app with the eas
command the application crushes or gets stuck in the splash screen.
here's the the part were i reload the application
const loadI18n = async () => {
const lang: string | null = await localStorage.getValue("lang");
const selectedLanguage: LanguageModel = env.languages.find((x: LanguageModel) => x.lang === ((lang !== null) ? lang : env.defaultLanguage));
if (lang === null) {
localStorage.save("lang", env.defaultLanguage);
} else {
console.log("a language is already selected, The language: ", lang)
}
i18n.init()
.then(async () => {
console.log("==============> I18nManager.isRTL: ", I18nManager.isRTL)
const RNDir = selectedLanguage.layout;
console.log("isRTL: ", RNDir);
console.log("current language is :", i18next.language, "i18n.dir: ", i18n.dir);
if ((i18n.dir !== RNDir) || (!I18nManager.isRTL && selectedLanguage.layout === 'RTL')) {
console.log("isRTL: ", RNDir);
console.log("current language is :", i18next.language, "i18n.dir: ", i18n.dir);
const isLocaleRTL = selectedLanguage.layout === 'RTL';
I18nManager.forceRTL(isLocaleRTL);
I18nManager.allowRTL(isLocaleRTL);
console.log("isLocaleRTL: ", selectedLanguage.layout === 'RTL');
await Updates.reloadAsync();
}
setIsI18nInitialized(true);
})
.catch((error: any) => console.warn(error));
}
and here's the eas file:
{
"cli": {
"version": ">= 3.5.2"
},
"build": {
"qaMA": {
"android": {
"gradleCommand": ":app:assembleRelease"
},
"releaseChannel": "qa",
"env": {
"APP_COUNTRY": "MA"
}
},
},
"submit": {
"production": {}
}
}
command I built with eas build -p android --profile qaMA
Same situation. i was ugraded expo SDK 44 to 49. with same language library.