-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'try!' expression unexpectedly raised an error: disk I/O error (code: 10) when device is locked #3855
Comments
Hi @mmathewsTableau , Thank you for reporting the issue. I followed your reproduction steps, but I didn't encounter any crash logs. Instead, I observed the following behavior:
System Error log is like this:
Btw, I am testing with Xcode 15.4. Is the crash log you mentioned in the ticket generated by Xcode, or by another service such as Firebase Crashlytics? |
@5d , thanks for trying it and it's interesting you got different results. The crash log I submitted was from another service (ie bugsnag). Let me try to repro again to see if there's more subtleties around the repro steps that I need to include. |
Hi @mmathewsTableau , Thanks for the updated information. |
Thanks @5d! I'm very excited to try out your fix. What is your recommended way to update my local Amplify package dependency to point to one with your fix? (back when we used cocoapods, it was relatively easy to patch a pod dependency locally but I don't have any experience doing it as xcode package dependencies) |
HI @mmathewsTableau , To change the dependency to a specific branch in Xcode using Swift Package Manager (SPM), follow these steps (instructions from GPT): 1. Open Your Xcode ProjectMake sure your project or workspace is open in Xcode. 2. Navigate to Package Dependencies
3. Edit the DependencyIf the package is already added, you need to update it:
4. Specify the Repository and BranchIf you’re adding a new dependency:
If you are editing an existing dependency:
5. Update the PackageAfter you’ve specified the branch, click Next, and then Finish. Xcode will resolve the package and fetch the specified branch. Example of a Package Dependency Setup for a Specific BranchIf you're manually editing the .package(url: "https://github.com/your/repo.git", .branch("develop")), 6. Clean and BuildOnce you’ve added or edited the package dependency, make sure to clean and build your project:
This will update your project to use the specific branch of the Swift package. |
@5d, Thanks for the detailed steps. Was able to get a build going with your changes. I tried my repro steps 5 times and I was never able to get it into the fatal state so the changes you made definitely helped and from what I can tell, prevents the crash. Would appreciate it if it can be included in a future release. Thanks! |
@mmathewsTableau , |
Hi @mmathewsTableau , The patch PR has been merged and included in the version 2.39.1 release. I am closing this issue for now, but feel free to reopen it if the problem persists. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Whenever our app is locked and aws pinpoint is trying to read the database, we get this error followed by a crash. The error is expected because we have our app set to be NSFileProtectionComplete, which will encrypt the filesystem while the device is locked. However, our ask is that the Amplify library gracefully handles this scenario instead of crashing the app.
Steps To Reproduce
Expected behavior
The app should fails to read but app does not crash.
Amplify Framework Version
2.27.3
Amplify Categories
Analytics
Dependency manager
Swift PM
Swift version
5.9.2
CLI version
N/A
Xcode version
15.2
Relevant log output
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 17.6.1
Device
iPhone 14.5
Specific to simulators
No
Additional context
No response
The text was updated successfully, but these errors were encountered: