react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.75k stars 466 forks source link

Error: Failed to write manifest。 #1152

Open chen834921478 opened 1 month ago

chen834921478 commented 1 month ago

What happened?

[Error: Failed to write manifest file.Error Domain=NSCocoaErrorDomain Code=4 "The folder “manifest.json” doesn’t exist." UserInfo={NSFilePath=/Users/xxx/Library/Developer/CoreSimulator/Devices/ABA7A135-7070-41CE-8A0B-80192332E934/data/Containers/Data/Application/13CD016E-0375-465C-9F4F-C6C3257A66D1/Library/Application Support/xxx/RCTAsyncLocalStorage_V1/manifest.json, NSUserStringVariant=Folder, NSUnderlyingError=0x600000da02d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}, NSURL=file:///Users/xxx/Library/Developer/CoreSimulator/Devices/ABA7A135-7070-41CE-8A0B-80192332E934/data/Containers/Data/Application/13CD016E-0375-465C-9F4F-C6C3257A66D1/Library/Application%20Support/xxxx/RCTAsyncLocalStorage_V1/manifest.json}]

Version

1.23.1

What platforms are you seeing this issue on?

System Information

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M3
  Memory: 94.28 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
    path: /opt/homebrew/opt/node@20/bin/node
  Yarn:
    version: 4.5.0
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /opt/homebrew/opt/node@20/bin/npm
  Watchman:
    version: 2024.09.09.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to Reproduce

After performing multiple AsyncStorage.remove operations and then restarting the app:

mensonones commented 3 weeks ago

Hi, @chen834921478!

detail more about the problem and if possible provide a minimal example of reproducing the problem

drewjenkins commented 3 weeks ago

Also encountering this. Unsure of STR, I think it just started happening once I upgraded to the latest version. Can't write, fetch, or clear items.

gemartinez56 commented 2 weeks ago

Exact same issue here. But with version async storage@1.18.1 – has anyone repro'd?

mensonones commented 2 weeks ago

If you or anyone else is still having this issue and can share a minimal reproduction of it, I would be happy to try to help.

poojagupta-trilogy commented 1 week ago

Any update on this?, after updated to react-native: 0.76.1 & react-native-async-storage: 2.0.0 (NOBRIDGE) ERROR Error storing data [Error: Failed to write manifest file.Error Domain=NSCocoaErrorDomain Code=4 "The folder “manifest.json” doesn’t exist." UserInfo={NSUnderlyingError=0x301950360 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}, NSUserStringVariant=Folder, NSURL=file:///private/var/mobile/Containers/Data/Application/D99F0782-0F91-4DC3-8C8A-F93AC816A7EA/Library/Application%20Support/gt.school.app/RCTAsyncLocalStorage_V1/manifest.json}]

guihendias commented 1 week ago

Same issue with expo 51

drewjenkins commented 1 week ago

Hey, here is a temporary fix I found to the issue.

  1. npm install patch-package
  2. In your package.json scripts, add "postinstall": "patch-package"
  3. Within the base dir of your project, create a folder named patches
  4. Within that folder, create a file named xcode+3.0.1.patch
  5. Paste the following into the file, save, and re-run npm install. After that it should patch the issue and be fixed.
diff --git a/node_modules/xcode/lib/pbxProject.js b/node_modules/xcode/lib/pbxProject.js
index 068548a..b478056 100644
--- a/node_modules/xcode/lib/pbxProject.js
+++ b/node_modules/xcode/lib/pbxProject.js
@@ -1678,8 +1678,7 @@ function correctForFrameworksPath(file, project) {

 function correctForPath(file, project, group) {
     var r_group_dir = new RegExp('^' + group + '[\\\\/]');
-
-    if (project.pbxGroupByName(group).path)
+    if (project.pbxGroupByName(group)&&project.pbxGroupByName(group).path)
         file.path = file.path.replace(r_group_dir, '');

     return file;