Reputation: 372
I have installed "npm install @react-navigation/native" and all the dependencies with it "npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view". After installation when I build the app and , its building successfully but getting crashed after installing on my phone.
when I uninstall the dependency react-native-safe-area-context, app is running but it suppose to be needed to use react navigation.
I am using windows machine, testing on my android phone.
package.json
{
"name": "Money",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.6",
"@react-navigation/bottom-tabs": "^5.0.5",
"@react-navigation/drawer": "^5.0.5",
"@react-navigation/native": "^5.0.5",
"@react-navigation/stack": "^5.0.5",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.6.0",
"react-native-reanimated": "^1.7.0",
"react-native-screens": "^2.0.0-beta.7",
"react-native-vector-icons": "^6.6.0"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Upvotes: 1
Views: 828
Reputation: 372
Solved this issue by doing this work around.
Can confirm, crashing immediately after launch on Android, no problems on iOS. It seems there is a Java class missing.
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;
Add the following dependencies to app/build.gradle to avoid this error:
implementation 'androidx.appcompat:appcompat:1.2.0-alpha02' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03'
Upvotes: 2