Skip to content

Commit cddd160

Browse files
committed
Add OkHttp dependency and change replink script
1 parent 0d94f1d commit cddd160

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ android {
3434

3535
dependencies {
3636
compile 'com.facebook.react:react-native:+'
37-
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
37+
compile 'com.squareup.okhttp3:okhttp:3.4.1'
3838
}

src/scripts/prelink.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ if(VERSION >= 0.29) {
3535

3636
}
3737

38-
if(VERSION < 0.28) {
38+
// if(VERSION <= 0.28) {
3939
// console.log('You project version is '+ VERSION + 'which does not meet requirement of react-native-fetch-blob 7.0+, please upgrade your application template to react-native 0.27+, otherwise Android application will not working.')
4040
// add OkHttp3 dependency fo 0.28- project
41-
var main = fs.readFileSync(PACKAGE_GRADLE);
42-
console.log('adding OkHttp3 dependency to pre 0.28 project .. ')
43-
main = String(main).replace('//{RNFetchBlob_PRE_0.28_DEPDENDENCY}', "compile 'com.squareup.okhttp3:okhttp:3.4.1'");
44-
fs.writeFileSync(PACKAGE_GRADLE, main);
45-
console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
46-
}
41+
// var main = fs.readFileSync(PACKAGE_GRADLE);
42+
// console.log('adding OkHttp3 dependency to pre 0.28 project .. ')
43+
// main = String(main).replace('//{RNFetchBlob_PRE_0.28_DEPDENDENCY}', "compile 'com.squareup.okhttp3:okhttp:3.4.1'");
44+
// fs.writeFileSync(PACKAGE_GRADLE, main);
45+
// console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
46+
// }
4747

4848
// set file access permission for Android < 6.0
4949
fs.readFile(MANIFEST_PATH, function(err, data) {

0 commit comments

Comments
 (0)