6

I'm developing React Native app with Expo. I'm having problems with my app in Android because always send me same error Message:

ReferenceError: Can't find variable: Intl

Reading many post, but I'm still with the same problem

"react-native": "0.68.2",
"expo": "^45.0.6",
"native-base": "^3.4.15",

Here's my /android/app/build.gradle

 def jscFlavor = 'org.webkit:android-jsc-intl:+'

 if (enableHermes) {
     ...
 } else {
     implementation jscFlavor
 }

3 Answers3

0

you can try this solution, if enableHermes is true.

If disabling Hermes is not an option in your app/build.gradle, and you cant use

  • It could be an option but I have about 30 languages in my app. I had to add every single import? because I had them when I init i18n. Maybe there's another way to do NumberFormat without Intl? or using i18nNext? – Elena Martín Castillo Sep 28 '22 at 15:43
0

EDIT:

I noticed that jsc-android-buildscripts is supported by Expo and you might not need to install it if you are using expo. I uninstall it and it worked. Sorry it might not be the answer but I will leave it to others who might have the same problem as me

Do you have this installed? I want to use Luxon and I got the same error as you and then noticed that they recommended using jsc-android-buildscripts

My problem was that in my /android/app/build.gradle jscFlavor was set to 'org.webkit:android-jsc:+'

Adham
  • 124
  • 1
  • 11
0

Please try to install Intl:

expo install intl

and then add imports in your file where you use intl:

import 'intl';
import 'intl/locale-data/jsonp/en';