简体   繁体   English

文件 ”<appName> .app”无法打开,因为您没有查看它的权限

[英]The file “<appName>.app” couldn’t be opened because you don’t have permission to view it

I get the following warning when I try to run my app:当我尝试运行我的应用程序时,我收到以下警告:

The file “WxChase.app” couldn't be opened because you don't have permission to view it.无法打开文件“WxChase.app”,因为您没有查看它的权限。

I have looked through all the previous questions I could find and can't find an answer.我已经浏览了我能找到的所有以前的问题,但找不到答案。

I have tried:我试过了:

  • Replacing my info.plist替换我的 info.plist
  • Deleting Derived Data删除派生数据
  • Duplicating my app复制我的应用程序
  • Editing the permission on the folder of the project编辑项目文件夹的权限
  • Changing "Compiler for C/C++/Objective-C" to Default in Build Settings在构建设置中将“C/C++/Objective-C 编译器”更改为默认值
  • Checking my architectures检查我的架构
  • Cleaning My Project清理我的项目

Thanks for your help!谢谢你的帮助!

Update: I can not run it in simulator or on my phone.更新:我无法在模拟器或手机上运行它。

select info选择信息

Enter Bundle name As : ${PRODUCT_NAME}输入包名称为: ${PRODUCT_NAME}

Executable file : ${EXECUTABLE_NAME}可执行文件: ${EXECUTABLE_NAME}

I also saw this occur when some of the items of source code were not included in the Target Membership for this particular target.当某些源代码项未包含在此特定目标的目标成员资格中时,我也看到了这种情况。 It compiles just fine either way, but it won't run unless you check the boxes for Target Membership in the File Inspector.无论哪种方式它都可以很好地编译,但除非您选中文件检查器中的目标成员资格框,否则它不会运行。 The error given is the same lack of permissions message above.给出的错误与上面的缺少权限消息相同。

Go into your build settings change Compiler for C/C++/Objective-C to Default compiler (Apple LLVM 6.0) instead of Unsupported Compiler(com.apple.compilers.llvmgcc42) for project.进入您的构建设置,将 C/C++/Objective-C 的编译器更改为默认编译器(Apple LLVM 6.0)而不是项目的不支持编译器(com.apple.compilers.llvmgcc42)。

You can refer this question "The file "MyApp.app" couldn't be opened because you don't have permission to view it" when running app in Xcode 6 Beta 4 在 Xcode 6 Beta 4 中运行应用程序时,您可以参考这个问题“无法打开文件“MyApp.app”,因为您无权查看它

重新安装 pod 对我有用我的错误是:我使用更新到推荐设置警告,默认情况下 xcode 更新我的 pod,但它不会更新我的 podfile,所以只使用“pod install”对我有用

On XCode 7.3 I got the same issueXCode 7.3 上我遇到了同样的问题

Mistake I did我做的错

I just Added physical folders and moved my files into them, problem started.我刚刚添加了物理文件夹并将我的文件移动到其中,问题开始了。

I also tried everything我也尝试了一切

  • Default compiler默认编译器
  • Clean and build清洁和构建
  • Reset simulator and reboot simulator, Xcode, iPhone even mac重置模拟器并重启模拟器、Xcode、iPhone 甚至 mac
  • Updated Info.plist更新了 Info.plist
  • Deleting Derived Data删除派生数据
  • Editing the permission on the folder of the project编辑项目文件夹的权限
  • Checking my architectures检查我的架构

nothing worked :(没有任何效果:(

How I resolved我是如何解决的

I just deleted those physical folders , clean build and YESS!!我刚刚删除了那些物理文件夹,清理构建和是!! It works!!有用!!

I encountered the same problem after I inadvertently removed a folder from the XCode project that contained several required files.我无意中从包含几个必需文件的 XCode 项目中删除了一个文件夹后,我遇到了同样的问题。 Oddly, that folder contained both the LaunchScreen and Main storyboards, as well as the project's custom (and only) AppDelegate... yet I was able to build the project without error, and the only error presented when I clicked "Run" was the "you don't have permission" dialog box, not a runtime error complaining of missing files/references/dependencies.奇怪的是,该文件夹包含 LaunchScreen 和 Main 故事板,以及项目的自定义(且唯一)AppDelegate ......但我能够无错误地构建项目,并且当我单击“运行”时出现的唯一错误是“您没有权限”对话框,而不是抱怨缺少文件/引用/依赖项的运行时错误。

Moral of the story: In addition to all of the other troubleshooting suggestions above, make sure your project contains all of the folders and files that it depends on.故事寓意:除了上述所有其他故障排除建议外,请确保您的项目包含它所依赖的所有文件夹和文件。

I usually do it by one of the below ways.我通常通过以下方式之一来做到这一点。

从 Xcode > Preferences > Location 中删除派生数据并重建项目对我来说很有效。

I tried various way listed here in the answers, not worked.我尝试了答案中列出的各种方法,但没有奏效。

Finally I did following and it worked on Xcode 10.1 :最后我做了以下工作,它在Xcode 10.1

Build settings->Product Name-> Changed the product name构建设置->产品名称->更改产品名称

The default is $(TARGET_NAME), and rebuild.默认为 $(TARGET_NAME),并重建。

Choose Legacy Build System Solved my problem选择 Legacy Build System 解决了我的问题

File -> Workspace Settings -> Build System: Legacy Build System文件 -> 工作区设置 -> 构建系统:传统构建系统

in my case, this issue happened after I added files (a folder) to my project via "Add Files to PROJECTNAME ...".于我而言,这个问题发生后,我通过添加的文件(文件夹)到我的项目“将文件添加到PROJECTNAME ......”。 To fix this I had to make sure that the files are added to the right target, which is selectable at the bottom of the window, in which window you choose the files/folder to be added.为了解决这个问题,我必须确保将文件添加到正确的目标,该目标可在窗口底部选择,您可以在哪个窗口中选择要添加的文件/文件夹。

For Ionic / Ionic (Capacitor)用于离子/离子(电容器)

Change -> CDVCamera.m更改 -> CDVCamera.m

(CDVPluginResult*)resultForVideo:(NSDictionary*)info
{
   NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
}

to This到这

(CDVPluginResult*)resultForVideo:(NSDictionary*)info
{
    NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];

    NSArray* spliteArray = [moviePath componentsSeparatedByString: @"/"];
    NSString* lastString = [spliteArray lastObject];
    NSError *error;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"tmp"];
    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:lastString];
   [fileManager copyItemAtPath:moviePath toPath:filePath error:&error];

   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
 }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法打开文件“ AppName.build”,因为您没有查看权限 - The file “AppName.build” couldn’t be opened because you don’t have permission to view it xcode 12:无法打开文件“app name”,因为您没有查看它的权限 - xcode 12: The file “app name” couldn't be opened because you don’t have permission to view it 文件“***.app”无法打开,因为您没有查看它的权限 - The file “***.app” couldn’t be opened because you don’t have permission to view it Xcode 9.4无法打开文件“ my_app”,因为您没有查看权限 - Xcode 9.4 The file “my_app” couldn’t be opened because you don’t have permission to view it 由于您没有权限,因此无法打开文件 - File couldn't be opened because you don't have permission 无法检索文件,错误:由于您无权查看该文件,因此无法打开该文件 - Cannot retrieve file, error: The file couldn’t be opened because you don’t have permission to view it 无法打开文件“ ”,因为您没有查看它的权限 - The file “ ” couldn’t be opened because you don’t have permission to view it Swift-Code = 257“无法打开文件“ ...”,因为您没有查看权限。” - Swift - Code=257 “The file “…” couldn’t be opened because you don’t have permission to view it.” 无法打开该文件,因为您没有查看它的权限(真实设备) - The file couldn’t be opened because you don’t have permission to view it (REAL DEVICE) 文件“MyApp”无法打开,因为您无权查看错误(Xcode 11) - The file “MyApp” couldn’t be opened because you don’t have permission to view it error (Xcode 11)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM