在拒绝 Codesign 访问 Keychain 后,Xcode 不会允许为 Device 构建

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47770693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:28:33  来源:igfitidea点击:

Xcode won't let to build for Device after denying Codesign to access Keychain

iosxcodekeychaincodesign

提问by Samitha Nanayakkara

I'm new to iOS development and today I tried to check my app on my iPhone and tried to build it for the device. So when I clicked on build, it asked to type my password to let codesign to access keychain. But after few attempts, I accidentally clicked on deny button. Then after again I tried to build my app for the device and now it says,

我是 iOS 开发的新手,今天我尝试在我的 iPhone 上检查我的应用程序并尝试为设备构建它。因此,当我单击构建时,它要求输入我的密码以让 codesign 访问钥匙串。但是经过几次尝试后,我不小心点击了拒绝按钮。然后我再次尝试为设备构建我的应用程序,现在它说,

Swift sodlib tool error, task failed with exit 1 signal 0

And when I check that error it says,

当我检查那个错误时,它说,

unknown error -1=ffffffffffffffff
error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign' 'A6646CD79C82476C1C35598A10134D3171EE09CD' '--verbose' '/Users/samitha/Library/Developer/Xcode/DerivedData/TestFoodTracker-gdcqosdrvtooqocosgttmwyzvgtg/Build/Products/Debug-iphoneos/TestFoodTracker.app/Frameworks/libswiftContacts.dylib'

What I Did

我做了什么

I tried to let codesign to access "keychain Access" and checked every key under login, but in Access Control section of each key, "Allow all applications to access this item" have been selected.

我试图让 codesign 访问“钥匙串访问”并检查登录下的每个键,但在每个键的访问控制部分,“允许所有应用程序访问此项目”已被选中。

I couldn't find any more ways to correct that mistake and let my app to be built for my device. Please if there anyone know how to correct this, just help me. Thanks.

我找不到更多的方法来纠正这个错误,让我的应用程序为我的设备构建。请如果有人知道如何纠正这个问题,请帮助我。谢谢。

回答by Samitha Nanayakkara

I found a solution for that. If that error occurs, only you have to do is just lock the keychain (click on lock in the left upper most corner). Then build again. It will ask to unlock again like first time and Let you to choose always allowor allowor denyin Codesign keychain access. Just type account (Mac User account) password and click on always allow. Then project will build successfully.

我找到了解决方案。如果发生该错误,您只需锁定钥匙串(单击左上角的锁定)。然后再次构建。它会像第一次一样要求再次解锁,并让您选择always allowallowdeny在 Codesign 钥匙串访问中。只需输入帐户(Mac 用户帐户)密码并单击始终允许。然后项目将成功构建。