In my flutter iOS app, every time the app is launched, it would call PathProvider.getApplicationDocumentsDirectory() to get the app documents directory to access to the previously saved data. If I install the app on an iOS device(not update here), the app could work exactly as expected. But if I updated the app from Apple Store or from Xcode, the app cannot longer be launched successfully. When I try to debug, I found the app caught exceptions at working with the drectory returned by PathProvider.getApplicationDocumentsDirectory(). Anybody could give some suggestions for fixing this? Thanks in advance.
For more information, when launched, my app has to execute createSync(recursive=true) if it does not find some app documents directories where I would store user-generated data. The app documents directories are returned by PathProvider.getApplicationDocumentsDirectory. However, after I updated the app, and when launched the app, PathProvider.getApplicationDocumentsDirectory() could still return a directory which has appropriate pattern, but the returned directory may not be the right directory since my app failed to find previously created folders there, so the app had to create the relevant directory for storing user-generated data again, and then I always got the error as below
FileSystemException: Creation failed (OS Error: Operation not permitted, errno = 1)
when I tried to create the directory with createSync(recursive=true), and no matter the version of path_provider was 1.20 or 1.10, the phenomenon persisted. Please help.
I assume the error you got is both happened in iOS simulator & iOS device ?
Get the path
Would you mind try to run on iOS simulator, and print out the path of the folder you try to access.
Open the folder in Finder
And with the printed folder path, you can open the folder with Finder by Cmd + G.
The error
Your mentioned error usually is because accessing the folder not belong to the app.
Let's see more after you print out the folder path.
Related
I am a Swift developer submitting an app made by a Unity3D developer colleague which is destined for the App Store. The Xcode project has this file in it:
Frameworks/Plugins/x86_64/ip_unity_plugin.bundle
...which I presume is required in order to run Unity within an iPhone app (yes, no?)
When validating the latest archive of the build I get this warning:
Code signing "ip_unity_plugin.bundle" failed.
View distribution logs for more information.
The logs state that:
.../myClients.app/ip_unity_plugin.bundle: unsealed contents present in the bundle root
Which has me like 🤷🏽♀️
Any ideas anyone?
Thank you for reading.
That bundle is actually the instant preview library for Google Daydream.
If you're building for release it's safe to delete it from the Assets/Plugins directory of Unity.
Alternatively you can mark the bundle to not be compiled by changing it's metadata in the inspector. You might also find that this problem goes away if you update to a newer version of instance preview.
I have an app that creates a file in the iCloud documents folder. It is working fine, in that the devices that the app is installed on can access and update the file successfully. In my code, a NSLog of the file path gives me:
///private/var/mobile/Library/Mobile%20Documents/iCloud~my-company-name~appname/Documents/document_name
As part of my testing, I need to be able to view this file from my mac. Previously, I was able to do this by looking in my library/Mobile documents folder at the respective app folder.
However, I can't see the app folder in there. Any ideas why this would now not be showing up or pointers to configuration settings I could check? (I'm on Xcode 6.1, mac is Yosemite and all devices are iOS8).
Finder now treats this as a 'special' folder, so actively prevents you browsing the structure. You can do this if you use Terminal instead.
In my app people can download some audio-lessons from my server. After a file is saved i move it to app's document directory. Now i want my app to have the first file downloaded with the app, so user have one lesson out of the box. I've added that file to main app directory (from xcode), and at the app startup i copy it to app's document directory. That all works fine, and now the problem: when i try to delete the copy of my audio file from main app directory i get the following error "The operation couldn’t be completed. Operation not permitted".
How that can be solved?
The task you are trying to achieve is not possible with iOS or any hacks that I know of. Even if it were, your app would be rejected by Apple since they do not allow an app to change contents of the main bundle in an app directory.
I am building an app called 'ToyBox.
When I build for iOS, I get a ToyBox.app directory which contains a ToyBox executable and the other typical iOS-related files (Info.plist, pkg.info, etc.), in addition to my app icons, assets and source code directories.
However the directory also contains another ToyBox.app sub-directory, which itself contains a ToyBox executable and iOS-related files and my assets directory.
It looks like Corona is recursively compiling my app. This happens whether I build for device or the Xcode iOS simulator. There is no problem running the resulting executable on my device (iPad4) or simulating it in Xcode but when I tried to submit my app to the App Store it was rejected with the following error:
"Invalid Bundle Structure - The binary file
'ToyBox.app/ToyBox.app/ToyBox' is not permitted. Your app may contain
only one executable file."
The error is valid - there are two executables!
(At the risk of confusing the issue, I have another, seemingly related, issue: if I build my app (either for device or Xcode simulator) then later build the app with a different name, in the same directory, the second build will include the first build and the build process will take a very long time to complete. If I was to build the app again with a third name, both previous app builds wold be included and the build would take a very (very) long time).
I can probably work around the issue by deleting the extra files, but this seems like a hack and I'd like to know what's going on.
I am using Corona Version 2013.1087 (2013.4.17).
Make sure you are not saving your Built app to the folder with your source code. You cannot put the output from building an app into the same folder with your source or you will get this error.
I am trying to run an app that someone developed and wanted me to test. The app was working fine for a long time by me placing the folder with long string of number and letters (e.g. 75E3C879-F608-45C6-A8AD-253A37FF92B8) into ~/Library/Application Support/iPhone Simulator/5.0/Applications. The simulator stopped working when I was trying to copy some new files into the same folder name without deleting the previous folder so OS X automatically appended "-1" to the end of the folder name (e.g. 75E3C879-F608-45C6-A8AD-253A37FF92B8 & 75E3C879-F608-45C6-A8AD-253A37FF92B8-1). When I launched the simulator with both those folders in ~/Library/Application Support/iPhone Simulator/5.0/Applications the simulator starts up and I see the app but when I click on it the screen flashes and then it does nothing. I have a feeling that because I had two folders with the same app it is causing some kind of error.
I am running xcode 4.2.1 on lion and have actually uninstalled and reinstalled xcode several times hoping it would clear out anything cached but have no luck so far. I don't have the actual source code so I can't create a new build myself. I've looked into all the different files that can possibly contain any reference to the app (e.g. ~/Library/Preferences/com.apple.iphonesimulator.plist, ~/Library/Caches/comapple.iphonesimulator, ~/Library/Application Support/iPhone Simulator, ~/Library/Save Application State/com.apple.iphonesimulaotr.savedState) and manually deleted them and still no luck.
I created a new user in OS X and ran the the app in the simulator without any issues so I can rule out that the build is bad. I really believe that the issue is some cache or preference tied to my user. Thanks for any help in advance.
What you are doing is a security violation, you are trying to modify the sandbox of an application from outside the application. Even if you get it to work, it should be considered a bug, because this kind of behavior doesn't make sense to allow. Can you imagine the fun time black hats would have modifying the sandbox files of an existing app to include malicious code, or modify databases? Only the app itself is allowed to modify those files.