This error message pops up when I try to use the sharing function in Photos. It pops up as soon as I select Airdrop or email a photo from Photos (Version 5.0 (121.17.170)) with Catalina (10.15.2). Not sure what’s happening or how to fix it. This doesn’t happen with I use GraphicConverter 11.1.2 and share photos.
Also, my computer is experiencing frequent crashes of photoanalysisd. I tried rebuilding my photo library (~38K photos); that didn’t do anything.
Anyone else seeing this?
Posted on Jan 1, 2020 11:29 AM
Bug
Error: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) at Object.fn [as saveToCameraRoll] (NativeModules.js:99) at Function.save (CameraRoll.js:163) at Function.saveToCameraRoll (CameraRoll.js:169) at _callee2$ (VM5 index.bundle:209) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:274) at Generator.prototype.<computed> [as next] (runtime.js:97) at tryCatch (runtime.js:45) at invoke (runtime.js:135) at runtime.js:170
Environment info
react-native info
output:
System: OS: macOS 10.15.3 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Memory: 60.19 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.0 - /var/folders/7n/tg8wdbns7yvg3wqwnh_mzmp40000gn/T/yarn--1585096434645-0.8370493466760465/node Yarn: 1.22.1 - /var/folders/7n/tg8wdbns7yvg3wqwnh_mzmp40000gn/T/yarn--1585096434645-0.8370493466760465/yarn npm: 6.13.7 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5
Library version: 1.4.0
Steps To Reproduce
- I am just calling the CameraRoll.saveToCameraRoll with the remote url
…
Describe what you expected to happen:
- I expected the video to be saved in the photos
- I even tried it on the latest version and its still the same
Reproducible sample code
CameraRoll.saveToCameraRoll(url, 'video')
.then(response => {
console.log('***RES**');
console.log(response);
console.log('***RES**');
this.setState({isDownloading: false});
this.refs.completionToast.show('Download completed!');
})
.catch(error => {
console.log('*****');
console.log(error);
console.log('*****');
this.setState({isDownloading: false});
this.refs.completionToast.show(
'There was a problem downloading the video, please try again later',
);
});
When I try to save an image to the phone (emulator IPhone 11 — iOS 13.1) gallery:
import CameraRoll from "@react-native-community/cameraroll";
...
CameraRoll.saveToCameraRoll('https://example.com/images/1.jpg', 'photo')
.then(() => {
alert('Saved to photos');
})
.catch((err) => {
console.log('err:', err);
});
, it gives me an error:
err: [Error: The operation couldn’t be completed. (PHPhotosErrorDomain
error -1.)]
I added these lines to the file «Info.plist»:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library</string>
And run command in «ios» folder:
pod update
pod install
But the error still remains. Is there anything I have to do to clean up the error?
asked Mar 15, 2020 at 0:09
I just faced the same situation, here’s how i solved it:
I’ve downloaded the file using rn-fetch-blob
:
let file
RNFetchBlob
.config({
fileCache: true,
appendExt: path.substring(path.lastIndexOf('.')+1, path.length)
//get the file's extension from the URL it's coming from and append to the file name that RNFectchBlob will create locally
})
.fetch('GET', path) //GET request to URL which has your file
.then((res) => {
file = res //var 'file' is the temp object which contains all data from our file
})
with the file saved locally on your app we can now call CameraRoll
to save the file:
CameraRoll.saveToCameraRoll(file.path())
.then(Alert.alert("Done!", "Your file has been saved."))
answered Mar 23, 2020 at 15:02
1
If this helps someone,
I got the same error in the React Native Cameraroll version 4.1.2. (iOS)
«react-native»: «0.63.3».
I solved the issue by prefixing «file://» in the image path for saveToCameraRoll/save method.
answered Mar 11, 2022 at 14:22
This error message pops up when I try to use the sharing function in Photos. It pops up as soon as I select Airdrop or email a photo from Photos (Version 5.0 (121.17.170)) with Catalina (10.15.2). Not sure what’s happening or how to fix it. This doesn’t happen with I use GraphicConverter 11.1.2 and share photos.
Also, my computer is experiencing frequent crashes of photoanalysisd. I tried rebuilding my photo library (~38K photos); that didn’t do anything.
Anyone else seeing this?
Posted on Jan 1, 2020 11:29 AM
Bug
Error: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) at Object.fn [as saveToCameraRoll] (NativeModules.js:99) at Function.save (CameraRoll.js:163) at Function.saveToCameraRoll (CameraRoll.js:169) at _callee2$ (VM5 index.bundle:209) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:274) at Generator.prototype.<computed> [as next] (runtime.js:97) at tryCatch (runtime.js:45) at invoke (runtime.js:135) at runtime.js:170
Environment info
react-native info
output:
System: OS: macOS 10.15.3 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Memory: 60.19 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.0 - /var/folders/7n/tg8wdbns7yvg3wqwnh_mzmp40000gn/T/yarn--1585096434645-0.8370493466760465/node Yarn: 1.22.1 - /var/folders/7n/tg8wdbns7yvg3wqwnh_mzmp40000gn/T/yarn--1585096434645-0.8370493466760465/yarn npm: 6.13.7 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5
Library version: 1.4.0
Steps To Reproduce
- I am just calling the CameraRoll.saveToCameraRoll with the remote url
…
Describe what you expected to happen:
- I expected the video to be saved in the photos
- I even tried it on the latest version and its still the same
Reproducible sample code
CameraRoll.saveToCameraRoll(url, 'video')
.then(response => {
console.log('***RES**');
console.log(response);
console.log('***RES**');
this.setState({isDownloading: false});
this.refs.completionToast.show('Download completed!');
})
.catch(error => {
console.log('*****');
console.log(error);
console.log('*****');
this.setState({isDownloading: false});
this.refs.completionToast.show(
'There was a problem downloading the video, please try again later',
);
});
Question
I am trying to store images which is getting from link to Gallery.
code:
let image = 'https://i.picsum.photos/id/190/200/300.jpg' CameraRoll.saveToCameraRoll(image, 'photo').then(r => { Alert.alert('alert', 'saved successfully .', [{ text: 'okay'}]); }) .catch((err) => { console.log(err); Alert.alert('error', ' error '+ err, [{ text: 'okay'}]); })
Error:
Error: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.)
Я только что столкнулся с такой же ситуацией, вот как я ее решил:
Я скачал файл, используя rn-fetch-blob
:
let file
RNFetchBlob
.config({
fileCache: true,
appendExt: path.substring(path.lastIndexOf('.')+1, path.length)
//get the file's extension from the URL it's coming from and append to the file name that RNFectchBlob will create locally
})
.fetch('GET', path) //GET request to URL which has your file
.then((res) => {
file = res //var 'file' is the temp object which contains all data from our file
})
с файлом, сохраненным локально в вашем приложении, теперь мы можем вызвать CameraRoll
чтобы сохранить файл:
CameraRoll.saveToCameraRoll(file.path())
.then(Alert.alert("Done!", "Your file has been saved."))
Go to ios
r/ios
Everything Apple iOS & iPadOS
Online
•
How do I fix the error “(PHPhotosErrorDomain error -1)”?
I’m trying to move a video on the app Documents to my camera roll, but it keeps on saying this error. What does it mean and do I fix it? Any help would be appreciated.
Я только что столкнулся с такой же ситуацией, вот как я ее решил:
Я скачал файл, используя rn-fetch-blob
:
let file
RNFetchBlob
.config({
fileCache: true,
appendExt: path.substring(path.lastIndexOf('.')+1, path.length)
//get the file's extension from the URL it's coming from and append to the file name that RNFectchBlob will create locally
})
.fetch('GET', path) //GET request to URL which has your file
.then((res) => {
file = res //var 'file' is the temp object which contains all data from our file
})
с файлом, сохраненным локально в вашем приложении, теперь мы можем вызвать CameraRoll
чтобы сохранить файл:
CameraRoll.saveToCameraRoll(file.path())
.then(Alert.alert("Done!", "Your file has been saved."))