|
@@ -12,6 +12,7 @@ if (!hasNecessaryFile) {
|
12
|
12
|
var package = JSON.parse(fs.readFileSync(PACKAGE_JSON));
|
13
|
13
|
var APP_NAME = package.name;
|
14
|
14
|
var APPLICATION_MAIN = process.cwd() + '/android/app/src/main/java/com/' + APP_NAME.toLocaleLowerCase() + '/MainApplication.java';
|
|
15
|
+var PACKAGE_GRADLE = process.cwd() + '/node_modules/react-native-fetch-blob/android/build.gradle'
|
15
|
16
|
|
16
|
17
|
var VERSION = checkVersion();
|
17
|
18
|
console.log('RNFetchBlob detected app version .. ' + VERSION);
|
|
@@ -28,11 +29,16 @@ if(VERSION >= 0.29) {
|
28
|
29
|
}
|
29
|
30
|
main = String(main).replace('new MainReactPackage()', 'new RNFetchBlobPackage(),\n new MainReactPackage()');
|
30
|
31
|
main = String(main).replace('import com.facebook.react.ReactApplication;', 'import com.facebook.react.ReactApplication;\nimport com.RNFetchBlob.RNFetchBlobPackage;')
|
|
32
|
+
|
31
|
33
|
fs.writeFileSync(APPLICATION_MAIN, main);
|
32
|
34
|
console.log('RNFetchBlob patching MainApplication.java .. ok')
|
33
|
35
|
|
34
|
36
|
}
|
35
|
37
|
|
|
38
|
+if(VERSION < 0.27) {
|
|
39
|
+ 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.')
|
|
40
|
+}
|
|
41
|
+
|
36
|
42
|
// set file access permission for Android < 6.0
|
37
|
43
|
fs.readFile(MANIFEST_PATH, function(err, data) {
|
38
|
44
|
|