braintree / braintree_ios

Braintree SDK for iOS
https://developer.paypal.com/braintree/docs/start/hello-client/ios/v5
MIT License
561 stars 292 forks source link

CardinalMobile.framework contains BitCode #1420

Closed asadmalik210 closed 1 month ago

asadmalik210 commented 1 month ago

Braintree SDK Version

Latest

Environment

Sandbox

Xcode Version

XCode 16

OS Version & Device

iOS 18

Integration type

CocoaPods

Development Processor

Intel

Describe the bug

The problem is that when I try to upload an app with braintree installed, it doesn't proceed saying it has bit code, like it uses CardinalMobile.framwork that contains bitcode, which is not supported in Xcode 16 onwards

To reproduce

Upload the app in latest xcode 16

Expected behavior

Doesn't let the app upload

Screenshots

No response

FetFrumos commented 1 month ago

Hame same issue, I used xcode 16. I can't published new version app in AppStore.

jaxdesmarais commented 1 month ago

Hello -

Are you able to share a screenshot of the error you are seeing when trying to upload your app?

Running the following commands on SDK version 6.23.3 within Frameworks/XCFrameworks/CardinalMobile.xcframework/ios-arm64/CardinalMobile.framework and Frameworks/XCFrameworks/CardinalMobile.xcframework/ios-arm64_x86_64-simulator/CardinalMobile.framework is returning no results indicating bitcode is not enabled for the Cardinal framework:

otool -l CardinalMobile | grep bitcode
otool -l CardinalMobile | grep __LLVM
FetFrumos commented 1 month ago

image @jaxdesmarais - my screen with errror

FetFrumos commented 1 month ago

used a temporary solution - added to POD file

post_install do |installer|
    installer.pods_project.targets.each do |target|
      flutter_additional_ios_build_settings(target)
    end

    bitcode_strip_path = `xcrun --find bitcode_strip`.chop!

    def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
      framework_path = File.join(Dir.pwd, framework_relative_path)
      command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
      puts "Stripping bitcode: #{command}"
      system(command)
    end

    framework_paths = [
      "Pods/Braintree/Frameworks/XCFrameworks/CardinalMobile.xcframework/ios-arm64_armv7/CardinalMobile.framework/CardinalMobile",
      "Pods/Braintree/Frameworks/XCFrameworks/CardinalMobile.xcframework/ios-arm64_i386_x86_64-simulator/CardinalMobile.framework/CardinalMobile",
      "Pods/Braintree/Frameworks/XCFrameworks/PPRiskMagnes.xcframework/ios-arm64/PPRiskMagnes.framework/PPRiskMagnes",
      "Pods/Braintree/Frameworks/XCFrameworks/PPRiskMagnes.xcframework/ios-arm64_x86_64-simulator/PPRiskMagnes.framework/PPRiskMagnes"
    ]

    framework_paths.each do |framework_relative_path|
      strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end
  end
jaxdesmarais commented 1 month ago

Hey @FetFrumos -

Are you able to confirm that Runner.app has been updated to the latest SDK version? You may also try running pod deintegrate and pod install to ensure it's pulling in the latest Braintree SDK version.

As mentioned I've confirmed via the command line that neither package has bitcode enabled. Additionally I uploaded a new cocoapods project using version 6.23.3 and am not running into this issue. If you are still running into issues after checking the Braintree SDK version in your app, please send over a small sample project reproducing the error and we would be happy to take a look.

jaxdesmarais commented 1 month ago

Closing due to inactivity. Please feel free to respond to this thread with additional details and we would be happy to investigate further.