"Use of undeclared identifier 'Braintree'" 在不使用 CocoaPods 的情况下手动集成 Braintree 后出错
"Use of undeclared identifier 'Braintree'" error after manual Braintree integration without using CocoaPods
调用 [Braintree braintreeWithClientToken
时出现以下错误。
ViewController.m:21:27: Use of undeclared identifier 'Braintree'
我按照 Manual Integration Without CocoaPods 指南将 Braintree 添加到新的 Objective-C 项目。
解决方案 - 构建 Braintree.framework
我已经成功构建了一个 Braintree.framework 可以轻松用于 iOS 应用程序,Objective-C 或 Swift。
有说明:
https://github.com/exchangegroup/braintree-framework-builder
这是修复您的演示中的此错误的 PR:https://github.com/exchangegroup/brain-tree-manual-setup-error-four/pull/1
这是修复您较新演示中的此错误的 PR:https://github.com/exchangegroup/braintree-manul-setup-ten/pull/1
不幸的是,使用 <angled>
包含的 #import
语句必须替换为 "quotes"
。虽然不理想,但通过使用查找和替换正则表达式,这是一个简单的操作:<Braintree/(.*)>
-> ""
如果您要进行新的集成,Braintree 建议 using CocoaPods instead。让我们知道是否存在 CocoaPods 不适用于您的用例的原因。
希望对您有所帮助:)
调用 [Braintree braintreeWithClientToken
时出现以下错误。
ViewController.m:21:27: Use of undeclared identifier 'Braintree'
我按照 Manual Integration Without CocoaPods 指南将 Braintree 添加到新的 Objective-C 项目。
解决方案 - 构建 Braintree.framework
我已经成功构建了一个 Braintree.framework 可以轻松用于 iOS 应用程序,Objective-C 或 Swift。
有说明:
https://github.com/exchangegroup/braintree-framework-builder
这是修复您的演示中的此错误的 PR:https://github.com/exchangegroup/brain-tree-manual-setup-error-four/pull/1
这是修复您较新演示中的此错误的 PR:https://github.com/exchangegroup/braintree-manul-setup-ten/pull/1
不幸的是,使用 <angled>
包含的 #import
语句必须替换为 "quotes"
。虽然不理想,但通过使用查找和替换正则表达式,这是一个简单的操作:<Braintree/(.*)>
-> ""
如果您要进行新的集成,Braintree 建议 using CocoaPods instead。让我们知道是否存在 CocoaPods 不适用于您的用例的原因。
希望对您有所帮助:)