我的应用没有权限 xcode 7

Posted

技术标签:

【中文标题】我的应用没有权限 xcode 7【英文标题】:my app don’t have permission xcode 7 【发布时间】:2016-01-11 05:31:12 【问题描述】:

我是目标 c 的新手。我删除了“编译源”中的所有类,之后出现错误:“文件 my app name 无法打开,因为您无权查看它。”。除此之外,我的应用程序运行良好。我尝试了很多解决方案,但它们都不起作用

我试过了:

替换我的 info.plist

删除派生数据

编辑项目文件夹的权限

在构建设置中将“C/C++/Objective-C 编译器”更改为默认值

检查我的架构

清理我的项目

感谢您的帮助!

更新:我无法在模拟器和设备中运行应用程序

编辑:将所有 .m 文件添加到“编译源”并得到如下错误:

 ld: entry point (_main) undefined. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

编辑:创建新项目并将类复制到新项目。又报错了

 Ld /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Products/Debug-iphoneos/maktub.app/maktub normal arm64
    cd /Volumes/Data/Projects/maktub
    export IPHONEOS_DEPLOYMENT_TARGET=6.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -L/Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Products/Debug-iphoneos -F/Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Products/Debug-iphoneos -filelist /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/maktub.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=6.0 -dead_strip -ObjC -lCocoaAsyncSocket -framework CFNetwork -framework Security -fobjc-arc -fobjc-link-runtime -lsqlite3 -lz.1 -lPods-maktub -Xlinker -dependency_info -Xlinker /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/maktub_dependency_info.dat -o /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Products/Debug-iphoneos/maktub.app/maktub

duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/SettingController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/SettingController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/IntroController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/IntroController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/AppDelegate.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/AppDelegate.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/ContactController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/ContactController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/RegisterController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/RegisterController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/AESCrypto.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/AESCrypto.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/SetNameController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/SetNameController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/ChatController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/ChatController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/GroupController.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/GroupController.o
duplicate symbol _key in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/GlobalMethod.o
duplicate symbol _iv in:
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/CheckCodeController.o
    /Users/sherzod/Library/Developer/Xcode/DerivedData/maktub-grrvlbarzrzucfdjeuhroypwrwpr/Build/Intermediates/maktub.build/Debug-iphoneos/maktub.build/Objects-normal/arm64/GlobalMethod.o
ld: 20 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

这有帮助吗? ***.com/questions/24924809/… @GenieWanted 感谢回答,但我做了任何建议,但没有找到解决方案 当我遇到这个问题时,我可以按照“Magreth deGraaf”的回答来解决它。你可以试一试吗? 参考这个answer 对这个问题有一个很好的总结。 【参考方案1】:

解决方案 1:

选择信息

Enter Bundle name As : $PRODUCT_NAME

Executable file : $EXECUTABLE_NAME

解决方案 2:

刚刚发现这可能是另一个问题。您的 Main.m 文件可能不再包含在 Build Phases -> compile sources 中。你会得到同样的错误。您可以通过单击加号并选择文件来重新添加它 来自对话框。

解决方案 3:

在 Finder 中转到包含项目的文件夹。

Click > Get Info

转到“信息”窗格的底部,然后单击小锁,在出现提示时输入您的密码。

然后,将自己的权限更改为读+写。

点击下方的小齿轮,应用到所有附上的物品。

完成后关闭锁!

如果这不起作用,请在 BUILD OPTIONS 下将“Compiler for C/C++/Objective-C”的值更改为 Default Compiler

也许对你有帮助。

【讨论】:

以上是关于我的应用没有权限 xcode 7的主要内容,如果未能解决你的问题,请参考以下文章

Xcode iOS 移除框架的权限请求

在没有权限和错误 ITMS-90121 之间提交的循环错误

为啥我的手机设置通用里面没有访问权限这个功能

SwiftUI在没有按钮的情况下询问通知权限

Google Play 控制台显示我的应用获得了后台位置权限,但我的应用没有

缺少蓝牙权限 - 但我的应用没有使用它