Search code examples
iosiphonexcodeswiftbraintree

Errors while implementing Braintree SDK in iOS app (swift 2.2 / xcode 7.3)


While Stripe integration was very simple, the Braintree integration is not working for me:

I am using the Braintree guide (https://developers.braintreepayments.com/start/hello-client/ios/v4) and implementing the SDK in an App designed for iOS 9.2 with Xcode 7.3 and Swift 2.2.

  1. I successfully installed the Braintree pod
  2. I've added the use_frameworks! statement in my pod file
  3. I've added import Braintree into my ViewController

... and then everything goes wrong when I try the simulator:

(1)

*error: /Users/Rob/Library/Developer/Xcode/DerivedData/Test-  anaajuuxtxcuorcukyrbchlrbqed/Build/Products/Debug-iphonesimulator/Braintree/Braintree-Drop-In-Localization.bundle: No such file or directory

(2)

error: /Users/Rob/Library/Developer/Xcode/DerivedData/Test-anaajuuxtxcuorcukyrbchlrbqed/Build/Products/Debug-iphonesimulator/Braintree/Braintree-UI-Localization.bundle: No such file or directory

(3)

No such module 'Braintree'*

Edit: I fixed (3) by adding a Bridge header (although I assumed based on the guide that you won't need one if you use use_frameworks!)

I see an additional error in Build phases:

*diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
    cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
    exit 1
fi*

(I updated CocoaPods and did the 'pod install', but its not working)

Any help?

Best,

Rob


Solution

  • I think this is an issue with CocoaPods 1.0.0 beta 6, based on this issue. I was able to work around this issue by reverting to 1.0.0 beta 5. Can you let me know if that fixes the issue?