The issue may be avoided by creating an .app file with permission to access the Keychain.
If you are building the app under test with Xcode
Please enable Keychain Sharing by following the steps in the article below.
Stack Overflow - SecItemAdd always returns error -34018 in Xcode 8 in iOS 10 simulator
If you are building the app under test with Bitrise
Please refer to the following help page.