我正在使用fastlane插件(aws_device_run_ios)在aws中的设备场中运行测试,但当我运行fastlane命令时出现了一些错误,这与aws无关,我认为这与firebase有关,我在项目中也使用了firebase
我没有找到任何解决方案可以帮助我,这就是我得到的错误
❌ /Users/admin/Desktop/MyIOSApp/Pods/FirebaseCore/Firebase/Core/FIRVersion.m:18:2:";未定义Firebase_VERSION:add-DFirebase_VERSION=。。。到构建调用";
错误";未定义Firebase_VERSION:add-DFirebase_VERSION=。。。到构建调用">
^
❌ /Users/admin/Desktop/MyIOSApp/Pods/FirebaseCore/Firebase/Core/FIRVersion.m:22:2:";FIRCore_VERSION未定义:add-DFIRCore_ERSION=。。。到构建调用";
错误";FIRCore_VERSION未定义:add-DFIRCore_ERSION=。。。到构建调用">
^
这个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.
我对快速车道了解不多,但xcargs
可能不是添加GCC_PREPROCESSOR_DEFINITIONS='AWS_UI_TEST'
的合适位置。它应该是特定于构建单元测试目标的设置,而不是影响应用程序中所有目标的设置。