【问题标题】:Couldn’t be opened because you don’t have permission to view it - React Native - Expo?无法打开,因为您无权查看 - React Native - Expo?
【发布时间】:2021-04-09 10:10:12
【问题描述】:

使用expo eject 弹出Expo 项目后,尝试使用Xcode "11.7" & Command-line "For iOS" 运行项目

我收到了这些错误,

注意:

Android 退出后运行良好

iOS 和 Android 在弹出之前运行良好。

Xcode

Details

The file “MyApp” couldn’t be opened because you don’t have permission to view it.
Domain: NSCocoaErrorDomain
Code: 257
Failure Reason: You don’t have permission.
Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.
User Info: {
    NSFilePath = "/Users/username/Library/Developer/Xcode/DerivedData/MyApp-bnfffrwsrhskljawuujrmpuwldgt/Build/Products/Debug-iphonesimulator/MyApp.app";
}
--
The operation couldn’t be completed. Permission denied
Domain: NSPOSIXErrorDomain
Code: 13
Failure Reason: Permission denied
--


System Information

macOS Version 10.14.6 (Build 18G95)
Xcode 11.7 (16142)

架构

命令行

npx react-native run-ios

info Found Xcode workspace "MyApp.xcworkspace"
info Launching iPhone 11 (iOS 13.7)
info Building (using "xcodebuild -workspace MyApp.xcworkspace -configuration Debug -scheme MyApp -destination id=60F7E669-0AE4-4CF3-9BC8-17027D01B172")
success Successfully built the app
info Installing "/Users/username/Library/Developer/Xcode/DerivedData/MyApp-bnfffrwsrhskljawuujrmpuwldgt/Build/Products/Debug-iphonesimulator/MyApp.app"
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/username/Library/Developer/CoreSimulator/Devices/60F7E669-0AE4-4CF3-9BC8-17027D01B172/data/Bundle/Application/3C7513F0-9BFE-4C94-A722-7C1BE6898E54/MyApp.app/MyApp : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
        Failed to chmod /Users/username/Library/Developer/CoreSimulator/Devices/60F7E669-0AE4-4CF3-9BC8-17027D01B172/data/Bundle/Application/3C7513F0-9BFE-4C94-A722-7C1BE6898E54/MyApp.app/MyApp : No such file or directory
info Launching "com.MyApp"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.MyApp" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "com.MyApp" is unknown to FrontBoard").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
        The operation couldn’t be completed. Application "com.MyApp" is unknown to FrontBoard.
        Application "com.MyApp" is unknown to FrontBoard.

【问题讨论】:

    标签: ios xcode react-native expo


    【解决方案1】:
    • 失败原因:您没有权限。

    首先请务必删除派生数据

    如果它不起作用,请更改终端权限。详细链接是here


    可能你不需要这个,但以防万一:

    也许用csrutil disable 禁用系统完整性保护对你有用。

    强烈建议您先阅读Apple document

    【讨论】:

    • 谢谢,但是如果不禁用系统完整性保护就没有办法解决这个问题吗?
    • 可悲的是,No 不起作用 :((,注意我有 Mojave Not Catalina,这个问题只是这个项目!
    • 不,这完全是关于一般设置,而不是特定于 Catalina,并且您的项目与此答案相关。
    • 好的,谢谢,但我发誓:3 这对我不起作用!
    【解决方案2】:

    我在使用react-native新建项目的时候也遇到了这个问题,这个问题我已经解决了。

    系统信息 macOS 版本 10.14.4 Xcode 11.3.1 (16142)

    在项目目录中运行“react-native --version”。版本是“react-native:0.64.0”。我使用“npx react-native init interview --version 0.63.4”创建了一个新项目。它成功了!

    所以我猜用旧版本创建一个新项目可以解决你的问题。

    【讨论】:

      猜你喜欢
      • 2016-03-10
      • 2018-08-09
      • 2014-07-09
      • 1970-01-01
      • 1970-01-01
      • 2015-02-23
      • 1970-01-01
      • 2018-12-25
      相关资源
      最近更新 更多