ant-design-mobile-rn
ant-design-mobile-rn copied to clipboard
[Bug] DatePickerView 日期选择器安卓环境报错java.lang.Boolean cannot be cast to java.lang.Double
💬 前提强调
- [X] I have searched the issues of this repository and believe that this is not a duplicate.
🙋 描述详情/重现步骤
版本:
"@ant-design/icons-react-native": "^2.3.2",
"@ant-design/react-native": "^5.1.0",
使用 DatePickerView 日期选择器安卓环境直接报错。
💻 运行环境
Android
⚫️ npx react-native info
输出信息
System: OS: macOS 14.0 CPU: (8) arm64 Apple M1 Memory: 69.45 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.18.0 path: /usr/local/bin/node Yarn: version: 1.22.21 path: /usr/local/bin/yarn npm: version: 9.8.1 path: /usr/local/bin/npm Watchman: version: 2023.11.13.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.14.3 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: version: 15.0.1/15A507 path: /usr/bin/xcodebuild Languages: Java: version: 11.0.20.1 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.7 wanted: 0.72.7 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
补充说明
No response
Picker改成纯js实现了,你这个native层报错和截图的代码应该无关。
检查一下以下几点:
- App.js有没有加
import 'react-native-gesture-handler';
- 有没有移除
@react-native-picker/picker
我把这部分代码去掉就不报错了。
app.js 加了如下图:
有没有移除@react-native-picker/picker:去掉了,如下图:
真机错误截图如下:
大致找到原因了:"react-native-gesture-handler": "^2.15.0",会产生上述问题。降级到"react-native-gesture-handler": "^2.14.0"即可。具体问题需要查看react-native-gesture-handler库
but I haven't used "react-native-gesture-handler" package in my project. Is it mandatory to have that package for ant-design package to work ?
相同的问题将react-native-gesture-handler降级到2.14.0 还是会报相同的错误
fixed in v5.1.1