pikaju / flutter-braintree

Flutter plugin that wraps the native Braintree SDKs. Enables payments with credit cards, PayPal, Google Pay and more.
https://pub.dev/packages/flutter_braintree
MIT License
64 stars 116 forks source link

error: could not find module 'Braintree' for target 'arm64-apple-ios-simulator'; #102

Open FortySL opened 2 years ago

FortySL commented 2 years ago

Hello, I am new in flutter and try to use Braintree as payment gate way for my app, It is woking for Android device simulator but there are some errors when building app in iOS simulator.

And I am using IMAC with M1 chip and the version of my Xcode is 13.1

Xcode's output: ↳ FBSDKLoginKit-bqyycziazehxroaqjoontmqzypqf /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_braintree-2.2.0/ios/Classes/BaseFlutterBraintreePlugin.swift:3:8: error: could not find module 'Braintree' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64, at: /Users/xxx/Desktop/xxx-app/build/ios/Debug-iphonesimulator/Braintree/Braintree.framework/Modules/Braintree.swiftmodule import Braintree ^ /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_braintree-2.2.0/ios/Classes/BaseFlutterBraintreePlugin.swift:3:8: error: could not find module 'Braintree' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64, at: /Users/xxx/Desktop/xxx-app/build/ios/Debug-iphonesimulator/Braintree/Braintree.framework/Modules/Braintree.swiftmodule import Braintree ^ /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_braintree-2.2.0/ios/Classes/BaseFlutterBraintreePlugin.swift:3:8: error: could not find module 'Braintree' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64, at: /Users/xxx/Desktop/xxx-app/build/ios/Debug-iphonesimulator/Braintree/Braintree.framework/Modules/Braintree.swiftmodule import Braintree ^ FBSDKLoginKit-bqyycziazehxroaqjoontmqzypqf Command CompileSwiftSources failed with a nonzero exit code FBSDKLoginKit-bqyycziazehxroaqjoontmqzypqf note: Using new build system note: Planning note: Build preparation complete note: Building targets in parallel

Could not build the application for the simulator. Error launching application on iPhone 13 Pro Max.

FortySL commented 2 years ago

Here is some of my settings for iOS part: Project/ios/Runner/AppDelegate.swift: @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) BTAppSwitch.setReturnURLScheme("com.xxx.app.braintree") return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }

Project/ios/Runner/Info.plist: `CFBundleURLTypes

CFBundleTypeRole Editor CFBundleURLSchemes com.googleusercontent.apps.xxxxxxxxxxx CFBundleTypeRole Editor CFBundleURLName com.xxx.app.braintree CFBundleURLSchemes com.xxx.app.braintree `
PurwadiPw commented 2 years ago

Same problem here

image

PurwadiPw commented 2 years ago

solved my problem

https://github.com/pikaju/flutter-braintree/issues/97#issuecomment-969164354

FortySL commented 2 years ago

solved my problem

#97 (comment)

Yes, it works, thx man!