com.facebook.react.common.JavascriptException: Can't find variable: Intl
See original GitHub issue- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
My debug builds are working perfectly fine, however, when trying to use a production build, the apk(Android) crashes with this error: com.facebook.react.common.JavascriptException: Can't find variable: Intl, stack:
Here’s the full stack trace:
05-14 16:33:42.145 18137 18176 E AndroidRuntime: com.facebook.react.common.JavascriptException: Can't find variable: Intl, stack:
05-14 16:33:42.145 18137 18176 E AndroidRuntime: <unknown>@488:88
05-14 16:33:42.145 18137 18176 E AndroidRuntime: d@2:768
05-14 16:33:42.145 18137 18176 E AndroidRuntime: n@2:409
05-14 16:33:42.145 18137 18176 E AndroidRuntime: t@2:262
05-14 16:33:42.145 18137 18176 E AndroidRuntime: <unknown>@487:171
05-14 16:33:42.145 18137 18176 E AndroidRuntime: d@2:768
05-14 16:33:42.145 18137 18176 E AndroidRuntime: n@2:409
05-14 16:33:42.145 18137 18176 E AndroidRuntime: t@2:262
05-14 16:33:42.145 18137 18176 E AndroidRuntime: <unknown>@484:191
05-14 16:33:42.145 18137 18176 E AndroidRuntime: d@2:768
05-14 16:33:42.145 18137 18176 E AndroidRuntime: n@2:409
05-14 16:33:42.145 18137 18176 E AndroidRuntime: t@2:262
05-14 16:33:42.145 18137 18176 E AndroidRuntime: <unknown>@306:411
05-14 16:33:42.145 18137 18176 E AndroidRuntime: d@2:768
05-14 16:33:42.145 18137 18176 E AndroidRuntime: n@2:409
05-14 16:33:42.145 18137 18176 E AndroidRuntime: t@2:262
05-14 16:33:42.145 18137 18176 E AndroidRuntime: <unknown>@12:42
05-14 16:33:42.145 18137 18176 E AndroidRuntime: d@2:768
05-14 16:33:42.145 18137 18176 E AndroidRuntime: n@2:339
05-14 16:33:42.145 18137 18176 E AndroidRuntime: t@2:262
05-14 16:33:42.145 18137 18176 E AndroidRuntime: global code@509:8
05-14 16:33:42.145 18137 18176 E AndroidRuntime:
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:746)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
05-14 16:33:42.145 18137 18176 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
Environment
Environment: OS: macOS High Sierra 10.13.3 Node: 10.0.0 Yarn: Not Found npm: 6.0.0 Watchman: Not Found Xcode: Xcode 9.3.1 Build version 9E501 Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.3 => 0.55.3
Steps to Reproduce
Run ./gradlew assembleRelease
, and start the app. The app crashes.
Expected Behavior
The should start just like it does in debug mode
Actual Behavior
The app crashes. There is no Intl
in use in the bundle file generated
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Using Intl properly in Android React Native app - Stack Overflow
Though it still says ReferenceError: Can't find variable: Intl . Then I gave up and tried to include custom JSC (I've confirmed that...
Read more >React native, ReferenceError: Can't find variable: Intl - Moralis
I'm create new project react native with library of React Moralis but I can't use it. I come with these errors ReferenceError: Can't...
Read more >Reactnativejs: Referenceerror: Can'T Find Variable: View
JavascriptException : Can't find variable: Intl, stack: Here's the full stack trace: 05-14 16:33:42.145 18137 18176 E AndroidRuntime: com.facebook.react.common.
Read more >React native modal bottom sheet examples pdf download ...
react-validex react-with-firebase-auth react.common. ... ReferenceError: Can't find variable: Intl react native android build react native.
Read more >反应本机参考错误找不到变量反应, Referenceerror 找不到变量导航 ...
即使我导入它,react-native 仍然找不到ReactDOM 变量。参考com.facebook.react.common.JavascriptException: ReferenceError: Can't find variable: typeAnnotation ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This will actually be fully supported in 0.60 through https://github.com/facebook/react-native/pull/24276 which adds a build flag to swap out JSC for Android.
@cpojer
I’m almost certain that 0.59 uses the non-international variant of the JSC, which means that this is still an issue. Using the International variant was discussed shortly here but there’s no record of the final decision.
Maybe it’s worth to consider adding a gradle flag (
addInternationalSupport
) for users that need theIntl
features (I believe it’s quite common in mobile apps)?