I have a react native app that I'm trying to run on Android. However, every time I try to load Android Studio, it complains that I have a duplicate import.
When I check, I can only find one of the imports it complains about:
client master % ag react-native-community_cameraroll
android/app/build.gradle
212: compile project(':@react-native-community_cameraroll')
android/settings.gradle
2:include ':@react-native-community_cameraroll'
3:project(':@react-native-community_cameraroll').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/cameraroll/android')
How would I fix this issue?
Not sure if this matters at all but here's my package.json
{
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web"
},
"dependencies": {
"@apollo/client": "^3.0.0-beta.41",
"@bugsnag/expo": "^6.5.0",
"@eva-design/eva": "^2.0.0-alpha.1",
"@expo/react-native-action-sheet": "^3.6.0",
"@react-native-community/async-storage": "^1.5.1",
"@react-native-community/cameraroll": "^2.0.0",
"@react-native-community/datetimepicker": "2.2.2",
"@react-native-community/masked-view": "0.1.6",
"@react-native-community/netinfo": "^5.7.1",
"@react-native-firebase/admob": "^6.4.0",
"@react-native-firebase/analytics": "^6.4.0",
"@react-native-firebase/app": "^6.4.0",
"@react-navigation/bottom-tabs": "^5.2.4",
"@react-navigation/compat": "^5.1.6",
"@react-navigation/native": "^5.1.3",
"@react-navigation/stack": "^5.2.8",
"@ui-kitten/components": "^5.0.0",
"@ui-kitten/eva-icons": "^5.0.0",
"apollo-cache-inmemory": "^1.6.5",
"apollo-client": "^2.6.8",
"apollo-link": "^1.2.13",
"apollo-link-context": "^1.0.19",
"apollo-link-error": "^1.1.12",
"apollo-upload-client": "^12.1.0",
"axios": "^0.19.0",
"bugsnag-react-native": "^2.23.7",
"expo": "^37.0.0",
"expo-blur": "~8.1.0",
"expo-camera": "~8.2.0",
"expo-constants": "~9.0.0",
"expo-file-system": "~8.1.0",
"expo-image-picker": "~8.1.0",
"expo-localization": "~8.1.0",
"expo-media-library": "~8.1.0",
"expo-notifications": "^0.1.1",
"expo-permissions": "~8.1.0",
"expo-updates": "^0.2.2",
"final-form": "^4.18.2",
"graphql": "^14.6.0",
"graphql-tag": "^2.10.1",
"i18n-js": "^3.3.0",
"lodash": "^4.17.15",
"lottie-ios": "^3.1.3",
"lottie-react-native": "^3.3.2",
"moment": "^2.24.0",
"moment-range": "^4.0.2",
"react": "~16.9.0",
"react-apollo": "^3.1.3",
"react-dom": "16.9.0",
"react-final-form": "^6.3.0",
"react-native": "~0.61.5",
"react-native-appearance": "~0.3.3",
"react-native-calendars": "^1.259.0",
"react-native-circular-progress": "^1.3.0",
"react-native-collapsible": "^1.5.1",
"react-native-drag-sort": "^2.1.1",
"react-native-elements": "^1.2.7",
"react-native-fast-image": "^8.1.5",
"react-native-gesture-handler": "~1.6.0",
"react-native-htmlview": "^0.15.0",
"react-native-iap": "^4.4.9",
"react-native-image-zoom-viewer": "^2.2.27",
"react-native-modal-datetime-picker": "^8.1.1",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-share": "^3.7.0",
"react-native-splash-screen": "^3.2.0",
"react-native-star-rating": "^1.1.0",
"react-native-svg": "^11.0.1",
"react-native-swiper": "^1.6.0-nightly.5",
"react-native-ui-kitten": "^4.3.2",
"react-native-unimodules": "^0.9.0",
"react-native-web": "^0.11.7",
"react-navigation": "^4.3.4",
"react-navigation-stack": "^1.9.0",
"react-navigation-tabs": "^2.5.5",
"react-redux": "^7.1.0",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"styled-components": "^4.3.2",
"victory-native": "^32.0.2"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.9.0",
"@types/react": "^16.9.11",
"@types/react-native": "^0.60.22",
"babel-preset-expo": "^8.1.0",
"typescript": "^3.8.3"
},
"resolutions": {
"apollo-client": "2.6.8"
},
"private": true
}
Weird, it seems OK,
remove the .iml and re-import the project. Let us know if this does the Job!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.