Closed fanzhiri closed 2 years ago
I add pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob' to the ios/Podfile , and run the cmd pod install , then the issue does not appear
I encountered the same problem. And the version I am using is 0.10.15
. And I figured out how to fix it.
You should manually add the libRNFetchBlob.a
to your target's linked frameworks and libraries. Follow the step Click the targets > General > Linked Frameworks and Libraries > Click + > Click libRNFetchBlob.a
.
After that, clean your iOS build and rerun your App. Then everything will back to normal.
Hi @gongmingqm10 the reason I cannot add libRNFetchBlob.a with my project is that react native 0.60.+ "installs" your 3rd party libraries through the Pods method and now we do not have to add those libraries under our .xcodeproj and then add .a files under Link binary with libraries. Are you also using RN 0.60.+ ??
I add pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob' to the ios/Podfile , and run the cmd pod install , then the issue does not appear
This did not work for me.
Same issue here. I got this error after replacing manually link to auto-linking. Any solution for that?
same here
Same here. :/
I think I've beaten this error (not sure because now my app builds and now that I'm in JS world I'm getting errors for linking issues with another library: react-native-push-notification). I think that this library's installation is being handled through Pods but I've also manually linked it by adding RNFetchBlob.xcodeproj under Libraries and I've also placed librn-fetch-blob.a under link binary with libraries. This is my Podfile:
platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'iosNottMyStyle' do
pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/React' pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
target 'iosNottMyStyleTests' do inherit! :search_paths
end
use_native_modules! end
target 'iosNottMyStyle-tvOS' do
target 'iosNottMyStyle-tvOSTests' do inherit! :search_paths
end
end
Any luck with this?
Having the same error here in android with RN 0.61.1 using autolink
To solve this @dca-ps
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
to podfile yarn add rn-fetch-blob
Same issue here, and @ckOfor solution did not work.
the same here, still hitting this bug and can not find the workaround (none of above working).
Facing the same problem on Android :/
Hi guys: the only fix I have found for this issue is to use the good old manual linking.
In MainApplication.java
add:
...
import com.RNFetchBlob.RNFetchBlobPackage;
...
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
...
new RNFetchBlobPackage(), <- add this
);
}
Ok, looks like it was related with 0.60 autolinking feature for me. Unlike @davidmarinangeli , I had to remove the packages import from my MainApplication.java. If you've just updated from react-native < 0.60, make sure that you've correctly enabled autolinking with this (in android/settings.graddle
) :
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
Here is the upgrade helper : https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.61.2
Ok, looks like it was related with 0.60 autolinking feature for me. Unlike @davidmarinangeli , I had to remove the packages import from my MainApplication.java. If you've just updated from react-native < 0.60, make sure that you've correctly enabled autolinking with this (in
android/settings.graddle
) :
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
Here is the upgrade helper : https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.61.2
I had this line at the bottom of my settings.gradle
file but it did not work 😢 . The helper has been useful indeed.
Hi guys: the only fix I have found for this issue is to use the good old manual linking.
In
MainApplication.java
add:... import com.RNFetchBlob.RNFetchBlobPackage; ... protected List<ReactPackage> getPackages() { // Add additional packages you require here // No need to add RnnPackage and MainReactPackage return Arrays.<ReactPackage>asList( ... new RNFetchBlobPackage(), <- add this ); }
I have tried this one, but no luck at all, I got the same, I got pretty much the same issue
console.log(
About to save ${url_video} into cameraRoll...`);
RNFetchBlob
.config({
fileCache : true,
appendExt : 'mp4'
})
.fetch('GET',url_video)
.then((res) => {
CameraRoll.saveToCameraRoll(res.path())
.then(()=>console.log("stored successfully"))
.catch(err => console.warn(err))
})`
Hi guys,
Recently I upgraded a RN app from v0.59.9 to v0.61.4. It had the same issue:
TypeError: null is not an object (evaluating 'RNFetchBlob.DocumentDir')
Here is my solution to the issue fix.
Add pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
to Podfile.
Run yarn add rn-fetch-blob && cd ios && pod install && cd .. && npx react-native run-ios
Hi guys i was facing the same issue resolved it by : -
For android make sure to run ./gradlew clean
I'm having this issue on Android 9.0+
Reinstalling, relinking, ./gradlew clean
, ./gradlew cleanBuildCache
does not help.
Works fine on Android 8.1 though
Hi guys: the only fix I have found for this issue is to use the good old manual linking. In
MainApplication.java
add:... import com.RNFetchBlob.RNFetchBlobPackage; ... protected List<ReactPackage> getPackages() { // Add additional packages you require here // No need to add RnnPackage and MainReactPackage return Arrays.<ReactPackage>asList( ... new RNFetchBlobPackage(), <- add this ); }
I have tried this one, but no luck at all, I got the same, I got pretty much the same issue
console.log(
About to save ${url_video} into cameraRoll...`);RNFetchBlob .config({ fileCache : true, appendExt : 'mp4' }) .fetch('GET',url_video) .then((res) => { CameraRoll.saveToCameraRoll(res.path()) .then(()=>console.log("stored successfully")) .catch(err => console.warn(err)) })`
Did you fix this error??
Was facing same issue for Android was related to MainApplication.java not being updated as part of upgrade from 0.59 - 0.60 as outlined by @abrantes01
I missed this step "react-native link rn-fetch-blob" and it was creating "null is not an object" error
I think this issue is a duplicate of https://github.com/joltup/rn-fetch-blob/issues/244
This was what fixed it for me https://github.com/joltup/rn-fetch-blob/issues/244#issuecomment-578537080
@pcowgill yes one just had to run pod install
after installing this package from npm.
In my case that didn’t work - it wasn’t until I deleted my Pods dir first that it worked.
Hi. Do we have any info about this issue? Seems like only Mac users with 'pod' are able to fix this.
I just found this. I'm using expo, so there is no chance to use rn-fetch-blob with expo? https://github.com/joltup/rn-fetch-blob/issues/517#issuecomment-573483891
hey, i am facing this issue on android, can anyone help me?
hey guys, if anyone facing this problem and already did the manual linking and still facing this problem, just delete your app from the simulator and reinstall the app. Worked for me.
Having the same issue as many of you I was trying to use this package on a React Native build for iOS and Android with redux-persist-filesystem-storage
I tried linking both automatically and manually (these instructions) to no avail. Also tried reinstalling, relinking, ./gradlew clean
, ./gradlew cleanBuildCache
for android and that didn't work.
I thought that it might have to do with the cycling issue (#183 ) and implemented the patch suggested here, but that didn't work.
I'm basically trying to get around AsyncStorage's 6mb limit on Android. Does anyone have alternate suggestions for redux storage options?
"react": "16.11.0",
"react-native": "0.62.2",
"redux-persist-filesystem-storage": "^2.1.0",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"react-redux": "^7.1.3",
I had that problem, so How I solved it ?
"react": "16.9.0", "react-native": "0.61.5", "rn-fetch-blob": "^0.12.0"
All commands bellow started at root folder
I installed the packed using yarn add rn-fetch-blob
Then I used react-native link rn-fetch-blob
After those commands I used RNFB_ANDROID_PERMISSIONS=true react-native link rn-fetch-blob
So, I go to ios folder using cd ios
then I installed pod using pod install
After those moves I opened my project.xcodeproj goes to
On general tab and added librn-fetch-blob.a using the plus signal
After that I closed my node server and iOS simulator, and click on Build at Xcode and it worked.
I hope it helped you too. ✌🏻👌🏻
I encountered the same problem. And the version I am using is
0.10.15
. And I figured out how to fix it.You should manually add the
libRNFetchBlob.a
to your target's linked frameworks and libraries. Follow the stepClick the targets > General > Linked Frameworks and Libraries > Click + > Click libRNFetchBlob.a
.After that, clean your iOS build and rerun your App. Then everything will back to normal.
I need before install pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
and after Link de Lib using Xcode, and works!
@alxmrtnz, Add rn-fetch-blog v0.12.0 as dependency to your project itself and it should work
did someone fixe this issue ? it just when you import this with expo. if you do it without expo it look like it work, use this in a project make with npx react-native, it work fine but not expo :/
Hi guys,
Recently I upgraded a RN app from v0.59.9 to v0.61.4. It had the same issue:
TypeError: null is not an object (evaluating 'RNFetchBlob.DocumentDir')
Here is my solution to the issue fix.
Add
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
to Podfile. Runyarn add rn-fetch-blob && cd ios && pod install && cd .. && npx react-native run-ios
pod install
did it for me, thanks 🥂
just go in node_modules->rn-fetch-blob->fs.js uncomment line 5 or replace line 13 with 'const RNFetchBlob = NativeModules.RNFetchBlob'
I am also having the same problem. but only suffer on android, ios it runs normally, please help me
any solution for Android?
manually link works for me on this issue for android:
any solution for Android?
see this : react-native-fetch-blob: https://github.com/wkh237/react-native-fetch-blob/wiki/Manually-Link-Package rn-fetch-blob: https://github.com/joltup/rn-fetch-blob/wiki/Manually-Link-Package#index
in node_modules/rn-fetch-blob/android/build.gradle
i added :
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
it works with me source : https://github.com/joltup/rn-fetch-blob/wiki/Manually-Link-Package#index
in Android->MainApplication.java add these 2 if you are using both after linking.. check if not present, add both:
new RNFSPackage(), new RNFetchBlobPackage()
facing the same issue. no solution yet?
Same here, RN 0.66 on Android :(
After a second thought, it's not the same issue on RN 0.66 :
TypeError: null is not an object (evaluating 'ReactNativeBlobUtil.DocumentDir')
We're having a similar issue after upgrading to React Native 0.60 and using auto linking.
Originally posted by @EgidioCaprino in https://github.com/joltup/rn-fetch-blob/issues/244#issuecomment-517205908