Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Braintree support for iOS 14/Xcode 12 #233

Closed
shivam-heady opened this issue Sep 22, 2020 · 17 comments · Fixed by #244
Closed

Braintree support for iOS 14/Xcode 12 #233

shivam-heady opened this issue Sep 22, 2020 · 17 comments · Fixed by #244

Comments

@shivam-heady
Copy link

shivam-heady commented Sep 22, 2020

Integration Details (please complete the following information):

  • SDK/Library Version: BraintreeDropIn v8.1.1
  • Environment: Sandbox
  • iOS Version: iOS 14.0
  • Device: Any iOS 14 simulator
  • Integration type & version Cocoapods 1.10.0.rc.1

Describe the bug
I'm unable to compile BraintreeDropIn and Braintree(it's Dependancy) on Xcode 12.0

I get the below error -
Showing Recent Messages
In /Users/shivam/Desktop/iOS/platform-x-os/Pods/Braintree/BraintreePayPal/PayPalDataCollector/Risk/libPPRiskMagnesOC.a(PPRMOCMagnesConstants.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/shivam/Desktop/iOS/platform-x-ios/Pods/Braintree/BraintreePayPal/PayPalDataCollector/Risk/libPPRiskMagnesOC.a' for architecture arm64`

I am aware of a "workaround" of adding arm64 in EXCLUDED_ARCHS, while it does work I think having Xcode 12 support would really help.

To Reproduce
Steps to reproduce the behavior:

  1. Integrate BraintreeDropIn via Cocoapods
  2. Compile the project
  3. Observer the compiler error

Expected behavior
Project should compile successfully..

@shivam-heady shivam-heady changed the title Braintree support for iOS 14/arm64 simulators Braintree support for iOS 14/Xcode 12 Sep 22, 2020
@scannillo
Copy link
Contributor

Hi - running BraintreeDropIn with CocoaPods v1.9.3, Xcode 12, and iOS 14 does not produce any compiler errors for me.

The EXCLUD_ARCHS workaround you're referring to is specific to Carthage integrations - see issues here and here.

@scannillo
Copy link
Contributor

Hi @shivamkapur - can you help us with some more details on how we can replicate your issue, such as sending us your Podfile?

@scannillo scannillo reopened this Sep 22, 2020
@mccarron
Copy link

@scannillo: FYI we're seeing this issue too, also with Cocoapods 1.10.0.rc.1. Guessing you're not seeing it as you are on Cocoapods 1.9.3 which is not recommended for use with Xcode 12, but evidently works better? Hah.

But EXCLUD_ARCHS works for this too to prevent trying to build arm64 for Simulator usage. So that work around also works for Cocoapods but won't with an ARM Mac later this year:

From the Xcode 12 Release Notes:

The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)

Hopefully this is helpful, having problems finding a reason why only Braintree is giving us problems right now though. Nothing looks out of the ordinary in the Framework configuration.

@shivam-heady
Copy link
Author

shivam-heady commented Sep 23, 2020

@scannillo - I'm using Xcode 12.0, Cocoapods version 1.10.0.rc.1.
Attaching the podfile as requested.

P.S. I've redacted others pods and retained all of the post install configuration.
Let me know if you need more info.

platform :ios, '11.1'

source 'https://github.com/CocoaPods/Specs.git'

# use for swift support
use_frameworks!

# per pod basis warning inhibits? =>  use :inhibit_warnings => true
inhibit_all_warnings!

def shared_pods
    
    # https://github.com/braintree/braintree-ios-drop-in
    pod 'BraintreeDropIn', '8.1.1'
    
end

target "PlatformX" do
    shared_pods
end

target 'PlatformXTests' do
    inherit! :search_paths
    shared_pods
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          blacklistedConfigurations = Array["Debug"]
          
          if target.name == "Braintree" || target.name == "BraintreeDropIn"
            if blacklistedConfigurations.include?(config.name)
              config.build_settings["EXCLUDED_ARCHS"] = "arm64"
            end
          end
          config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
          config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
          config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
 	    config.build_settings['SWIFT_VERSION'] = '4.2'
        end
    end
end

@scannillo
Copy link
Contributor

Hello again. I made a sample app and included the BraintreeDropIn dependency using CocoaPods 1.10.0.rc.1 on Xcode 12. I am able to run the sample app on an iOS 14 simulator and iOS 14 device. So, I am still unable to replicate.

@cristiano2lopes
Copy link

@scannillo More info: Also happened to me regardless of cocoapods version. Existing project from xcode 11 migrating to xcode 12. iOS 12 Deployment target.

@scannillo
Copy link
Contributor

Hello - for now, please use the workaround of setting EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 in your build configuration.

We've reached out to our internal team who manages libPPRiskMagnesOC.a/ PayPalDataCollector and will keep you posted on a potential fix.

@scannillo
Copy link
Contributor

Also - can you share the exact xcodebuild command you're using the trigger the issue?

@RamblinWreck77
Copy link

I just ran into a similar problem. On a new project with this pod file:

platform :ios, '13.6'

workspace 'Test.xcworkspace'

static_framework = true
ENV['COCOAPODS_DISABLE_STATS'] = "true"
use_frameworks!

target 'Test' do
   pod 'BraintreeDropIn', '8.1.1'
   pod 'Braintree/PayPal'
   pod 'Braintree/Venmo'
   pod 'Braintree/Apple-Pay'
end

Cocoapods 1.9.3 will give you the above errors. Cocoapods 1.10.rc.1 fixes the above errors, but adds a new one:

If you select "update pod project to recommended settings" you get deprecation/unable to compile errors. If you then pod deintegrate/pod install... without letting xcode "fix" the project it works.

Looks like there's lots of ancient objective C in this library.

@scannillo
Copy link
Contributor

scannillo commented Oct 16, 2020

Circling back to this issue while we wait for our Magnes team to get back to us.

For reference, this stack overflow post outlines the issue well.


We excluded arm64 simulator architectures in our Braintree xcodeproj in a branch called arm64-exclude in each repo. I'm not sure if this will solve your issue, but feel free to try it out in the meantime.

pod 'BraintreeDropIn', :git => 'https://github.com/braintree/braintree-ios-drop-in.git', :branch => 'arm64-exlude'
pod 'Braintree', :git => 'https://github.com/braintree/braintree_ios.git', :branch => 'arm64-exlude'

@artemisia-absynthium
Copy link

artemisia-absynthium commented Oct 29, 2020

I've experienced this issue as well and for me the problem was with (mis)using custom build configurations with Cocoapods, I noticed that the build settings of all of my build configurations except Debug were modeled after the Release configuration, even the other debug ones.

The problem in particular was that Build Active Architecture Only was set to No for the build configurations I was using for debug purpose.

To solve it I added the project setting in all of the target configurations on my Podfile, and I specified each custom build configuration as in the example in the last line of the Cocoapods Syntax Reference -> https://guides.cocoapods.org/syntax/podfile.html#project.

By configuring the Podfile properly and using the latest release of Cocoapods (1.10.0), the project was able to run out of the box after running pod deintegrate and pod install.

@sestevens
Copy link
Contributor

We've released a fix for this in the Braintree podspec in version 4.36.1. We'll update this issue again once this fix has been released in BraintreeDropIn as well.

@sestevens
Copy link
Contributor

This fix has been released in version 8.1.2 of BraintreeDropIn.

@tahirmt
Copy link

tahirmt commented Aug 16, 2021

@sestevens Any plans on bringing this back so we can build for arm64 simulators?

@scannillo
Copy link
Contributor

👋 Our 3DS provider, CardinalMobile, is still blocking this for us. You can follow that thread here - braintree/braintree_ios#564.

@abhishek-ios-stockX
Copy link

@scannillo Pointing to a specific example we can see that in the Braintree.podspec.json file for 5.4.3 they have these lines. This is what blocks us from migrating to SPM for other frameworks. Please help.

@scannillo
Copy link
Contributor

Hi @abhishek-ios-stockX - please open a new GitHub with more details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants