UnityNativeGallery icon indicating copy to clipboard operation
UnityNativeGallery copied to clipboard

Unable to Save Images/Videos (IOS)

Open mariocepoi opened this issue 1 year ago • 2 comments

Description of the bug

I am unable to save any files on ios , xcode returns this whenever a file is trying to be saved works flawlessly on android.

I also tried to delete the xcode project and regenerate it , double checked all the setting and even tried to setup native gallery manualy but nothing works .

Error getting remote object proxy for +[PLAssetsdPhotoKitClient sendChangesRequest:usingProxyFactory:reply:]_block_invoke: Error Domain=com.apple.photos.error Code=41002 "Unable to obtain photolibraryd XPC proxy for getPhotoKitAddServiceWithReply:. photolibraryd could have crashed" UserInfo={NSLocalizedDescription=Unable to obtain photolibraryd XPC proxy for getPhotoKitAddServiceWithReply:. photolibraryd could have crashed, NSUnderlyingError=0x600000296370 {Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.photos.service was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.photos.service was invalidated: failed at lookup with error 159 - Sandbox restriction.}}}

PhotoKit XPC proxy is invalid. Dropping request on the floor and returning an error: Error Domain=PHPhotosErrorDomain Code=3301 "(null)" (underlying error Error Domain=com.apple.photos.error Code=41002 "Unable to obtain photolibraryd XPC proxy for getPhotoKitAddServiceWithReply:. photolibraryd could have crashed" UserInfo={NSLocalizedDescription=Unable to obtain photolibraryd XPC proxy for getPhotoKitAddServiceWithReply:. photolibraryd could have crashed, NSUnderlyingError=0x600000296370 {Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.photos.service was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.photos.service was invalidated: failed at lookup with error 159 - Sandbox restriction.}}})

Error saving image with UIImageWriteToSavedPhotosAlbum: Error Domain=ALAssetsLibraryErrorDomain Code=-1 "Unknown error" UserInfo={NSLocalizedDescription=Unknown error, NSUnderlyingError=0x6000002037e0 {Error Domain=PHPhotosErrorDomain Code=3301 "(null)"}} UnityIAP: UpdatedTransactions UnityIAP: Finishing transaction 2000000606616576

This is how the save is called

``

  • Unity version: 6000.0.1f1
  • Platform: iOS
  • Device: Simulator , Build

mariocepoi avatar May 22 '24 20:05 mariocepoi

Screenshot 2024-05-22 234732

It seems that adding the items above solved the issue .

mariocepoi avatar May 22 '24 20:05 mariocepoi

In Automated Setup, they're added automatically via Linker Flags: https://github.com/yasirkula/UnityNativeGallery/blob/66157bd32db65439aca72ad5ed0f0fb702d6ef72/Plugins/NativeGallery/Editor/NGPostProcessBuild.cs#L125-L128

I guess another plugin's OnPostprocessBuild function calls SetBuildProperty(targetGUID, "OTHER_LDFLAGS", ...) to override Linker Flags instead of appending to it :smh:

I'll probably need to add these frameworks via AddFrameworkToProject API in the future.

yasirkula avatar May 26 '24 22:05 yasirkula