admin管理员组文章数量:1291004
I'm working on a project using React Native 0.72.4 (using the default Paper architecture) and I'm encountering build errors on Android related to react-native-screens. The error output (truncated) is as follows: I cant remove the navigation libraries they are mandatory.
e: .../node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt:3:27 Unresolved reference: BaseReactPackage
e: .../RNScreensPackage.kt:19:26 Unresolved reference: BaseReactPackage
e: .../RNScreensPackage.kt:24:5 'createViewManagers' overrides nothing
e: .../RNScreensPackage.kt:51:5 'getModule' overrides nothing
e: .../RNScreensPackage.kt:61:5 'getReactModuleInfoProvider' overrides nothing
Environment
- React Native: 0.72.4
- react-native-screens: Installed version is 4.6.0
- react-native-gesture-handler: Installed version is 2.16.0
- Android: Using standard Android project settings with auto-linking enabled
**Here is view of my package.json dependancies **
"dependencies": {
"@react-native-community/cli-platform-android": "^11.4.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/drawer": "^7.1.1",
"@react-navigation/native": "^7.0.14",
"@react-navigation/stack": "^7.1.1",
"axios": "^1.7.9",
"react": "18.2.0",
"react-native": "^0.72.4",
"react-native-gesture-handler": "^2.16.0",
"react-native-reanimated": "^3.15.1",
"react-native-safe-area-context": "^4.14.1",
"react-native-screens": "^4.6.0",
"react-native-vector-icons": "^10.2.0",
"rn-fetch-blob": "^0.12.0"
}
Question
- Could someone please advise on a set of version recommendations (or version matrix) that works reliably together? Specifically
- Is there a specific version of react‑native‑screens (for example, a version such as 4.4.0) that is known to work with React Native 0.72.4 (Paper) and React Navigation without triggering errors like the BaseReactPackage issue?
- Are the current versions of react‑native‑gesture‑handler (2.16.0) and the other navigation libraries (@react-navigation/bottom-tabs, etc.) compatible with that version of react‑native‑screens?
- Any additional configuration changes (e.g., in gradle or native code) that may be required?
I'm working on a project using React Native 0.72.4 (using the default Paper architecture) and I'm encountering build errors on Android related to react-native-screens. The error output (truncated) is as follows: I cant remove the navigation libraries they are mandatory.
e: .../node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt:3:27 Unresolved reference: BaseReactPackage
e: .../RNScreensPackage.kt:19:26 Unresolved reference: BaseReactPackage
e: .../RNScreensPackage.kt:24:5 'createViewManagers' overrides nothing
e: .../RNScreensPackage.kt:51:5 'getModule' overrides nothing
e: .../RNScreensPackage.kt:61:5 'getReactModuleInfoProvider' overrides nothing
Environment
- React Native: 0.72.4
- react-native-screens: Installed version is 4.6.0
- react-native-gesture-handler: Installed version is 2.16.0
- Android: Using standard Android project settings with auto-linking enabled
**Here is view of my package.json dependancies **
"dependencies": {
"@react-native-community/cli-platform-android": "^11.4.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/drawer": "^7.1.1",
"@react-navigation/native": "^7.0.14",
"@react-navigation/stack": "^7.1.1",
"axios": "^1.7.9",
"react": "18.2.0",
"react-native": "^0.72.4",
"react-native-gesture-handler": "^2.16.0",
"react-native-reanimated": "^3.15.1",
"react-native-safe-area-context": "^4.14.1",
"react-native-screens": "^4.6.0",
"react-native-vector-icons": "^10.2.0",
"rn-fetch-blob": "^0.12.0"
}
Question
- Could someone please advise on a set of version recommendations (or version matrix) that works reliably together? Specifically
- Is there a specific version of react‑native‑screens (for example, a version such as 4.4.0) that is known to work with React Native 0.72.4 (Paper) and React Navigation without triggering errors like the BaseReactPackage issue?
- Are the current versions of react‑native‑gesture‑handler (2.16.0) and the other navigation libraries (@react-navigation/bottom-tabs, etc.) compatible with that version of react‑native‑screens?
- Any additional configuration changes (e.g., in gradle or native code) that may be required?
1 Answer
Reset to default 2Your React Native version is incompatible with react-native-screens.
In the docs, it shows that to use versions 4.5.0+ then you must use react-native version 0.74+. You are using 0.72.4. I'd strongly recommend pinning your React Native version as discrepancies between versions can cause issues like this to frequently pop up.
Depending on how strict your time constraint is for this task, I'd recommend downgrading your RNScreens version, as opposed to upgrading React Naative - as that's a massive pain.
本文标签:
版权声明:本文标题:Unresolved reference: BaseReactPackage in react-native-screens on Android with React Native 0.72.4 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741522456a2383270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论