I'm using React-Native on my android program, after open my porject with react-native run-android
,the error occurred.The same error message occurred twice.
Unexpected identifier '_classCallCheck'.import call expects exactly one argument
Unexpected identifier '_classCallCheck'.import call expects exactly one argument
no stack
no stack
I googled this and try some solutions, but still can't resolve. Here is a similar problem that I have found: https://github.com/facebook/react-native/issues/23669
What I have been tried for this error:
- cd to /andorid, use
gradlew clean
- use
react-native start --reset-cache
- use
npm install -g react-native-cli
Here is my develop environment:
Android:
AVD version: Android 7.0 with Play Store
System:
OS: Windows 10 10.0.19043
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 2.11 GB / 15.71 GB
Binaries:
Node: 10.16.0 - D:\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.9.0 - D:\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 32
Build Tools: 28.0.3, 32.0.0
System Images: android-24 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7935034
Visual Studio: Not Found
Languages:
Java: 1.8.0_232
npmPackages:
@react-native-community/cli: Not Found
react: 16.9.0 => 16.9.0
react-native: ^0.64.0 => 0.64.3
react-native-windows: Not Found
npmGlobalPackages:
*react-native*: Not Found
Guys,I just solved this problem.Here's the link. https://github.com/babel/babel/issues/14139
from:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
to:
module.exports = {
presets: [['module:metro-react-native-babel-preset', {
unstable_disableES6Transforms: true
}]],
};