ios - "Firebase_VERSION is not defined: add -DFirebase_VERSION=... to the build invocation"

标签 ios firebase automated-tests fastlane aws-device-farm

我正在使用faSTLane插件(aws_device_run_ios)在aws的设备场中运行测试,但是当我运行faSTLane命令时出现一些错误,它与AWS无关,它与firebase 我想,我在项目中也使用了firebase

我没有找到任何解决方案可以帮助我,这是我得到的错误

❌/Users/admin/Desktop/MyIOSApp/Pods/FirebaseCore/Firebase/Core/FIRVersion.m:18:2:“Firebase_VERSION 未定义:将 -DFirebase_VERSION=... 添加到构建调用”

错误“Firebase_VERSION 未定义:将 -DFirebase_VERSION=... 添加到构建调用”

^

❌/Users/admin/Desktop/MyIOSApp/Pods/FirebaseCore/Firebase/Core/FIRVersion.m:22:2: “FIRCore_VERSION 未定义:添加 -DFIRCore_VERSION=... 到构建调用”

错误“FIRCore_VERSION 未定义:将 -DFIRCore_VERSION=... 添加到构建调用”

^

podfile 看起来像这样:

# Pods for MyIOSApp
pod 'Alamofire', '~> 4.7'
pod 'RSFloatInputView'
pod 'SkyFloatingLabelTextField', '~> 3.0'
pod 'SwiftyJSON'
pod 'SwiftKeychainWrapper'
pod 'Firebase/Core'
pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'

target 'MyIOSAppTests' do
    inherit! :search_paths
    pod 'Firebase/Core'
    # Pods for testing
end

target 'MyIOSAppUITests' do
    inherit! :search_paths
    pod 'Firebase/Core'
    # Pods for testing
end

这是我的快速文件:

lane :aws_device_run_ios do
ENV['AWS_ACCESS_KEY_ID']     = '******'
ENV['AWS_SECRET_ACCESS_KEY'] = '******'
ENV['AWS_REGION']            = 'us-west-2'
#Build For Testing
xcodebuild(
scheme: 'MyIOSApp',
destination: 'generic/platform=iOS',
configuration: 'Release',
derivedDataPath: 'aws',
xcargs: "GCC_PREPROCESSOR_DEFINITIONS='AWS_UI_TEST' 
ENABLE_BITCODE=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build-for-testing"
)
# Transform .app into AWS compatible IPA
aws_device_farm_package(
derrived_data_path: "aws",
configuration: "Release"
 )
 # RUN tests on AWS Device Farm
aws_device_farm(
device_pool:      "DeviceIOS"
)
end

如何解决这个错误,在错误中提到要添加 -DFirebase_VERSION=... 我不知道该怎么做以及在哪里做?! 请帮忙提前致谢

最佳答案

看起来 fastfile 正在覆盖用于构建 FirebaseCore pod 的 GCC_PREPROCESSOR_DEFINITIONS 选项。 "GCC_PREPROCESSOR_DEFINITIONS": "FIRCore_VERSION=5.4.1 Firebase_VERSION=5.20.0" 来自 https://github.com/CocoaPods/Specs/blob/master/Specs/8/b/d/FirebaseCore/5.4.1/FirebaseCore.podspec.json#L42 .

我对 faSTLane 不太了解,但 xcargs 可能不是添加 GCC_PREPROCESSOR_DEFINITIONS='AWS_UI_TEST' 的正确位置。它应该是特定于构建单元测试目标的设置,而不是影响应用程序中所有目标的设置。

关于ios - "Firebase_VERSION is not defined: add -DFirebase_VERSION=... to the build invocation",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55849281/

相关文章:

ios - 无法在 Swift 中对 UITableView 调用 "registerClass"

TeamCity测试失败统计

unit-testing - TDD:为什么是 'Red Green Refactor' 而不是 'Green Refactor' ?

ios - 如何在定时器选择器上传递参数

ios - 如何使用 Core Graphics 在我的触摸位置画一个圆圈?

Firebase Cloud Functions 和 Busboy 不解析字段或文件

firebase - 在 Windows 中是否可以在没有输入文件的情况下使用 firebase cli?

c# - Firebase 实时数据库 : how can I retrieve 10 records around a specific key after ordered by value?

javascript - 如何从 beforeEach 函数访问有关当前运行的测试用例的信息?

ios - swift 2 : UITableViewDataSource protocol extension