joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.83k stars 782 forks source link

Compile error in Android Studio: conflicting OkHttp3 libs (from expo #238

Open sgeier opened 5 years ago

sgeier commented 5 years ago

Steps to reproduce: -Created expo app via create-react-native-app -npm install -expo eject -npm install -g rn-fetch-blob -react-native link rn-fetch-blob -tried to compile project in Android studio and getting this error: error: incompatible types: expolib_v1.okhttp3.OkHttpClient cannot be converted to okhttp3.OkHttpClient

This library seems to be the only way to access SD Card contents on an Android device. I need this ;) Thanks for your help.

"dependencies": { "@expo/samples": "2.1.1", "expo": "^31.0.2", "expokit": "^31.0.2", "react": "16.5.0", "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz", "react-navigation": "^2.18.2", "rn-fetch-blob": "^0.10.13" },

bildschirmfoto 2018-11-19 um 14 24 10
sis-dk commented 5 years ago

Found any fix for this?

hesselberg commented 5 years ago

@sgeier any progress?

wodka commented 5 years ago

I am using a workaround in the meantime:

in all files change okhttp3 to expolib_v1.okhttp3 and okio to expolib_v1.okio also one occurence of new okhttp3 to new expolib_v1.okhttp3

node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java
node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobUtils.java
node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobBody.java
node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobDefaultResp.java
node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobFileResp.java