Dom*_*ski 6 xcode ios fastlane flutter bitrise
我的问题是,当使用 Firebase 时(cloud_firestore特别是),Flutter iOS 应用程序的构建时间变得很长,以至于我在 Bitrise 上的 CI 构建超时(28flutter build --release分钟,fastlane 的 20 分钟以上build_ios_app)。所以我无法在我的 CI 上执行完整的 iOS 构建。缓存当然是可能的,但首先必须完成初始构建:/
根据本指南,在使用 Fastlane 使用 Xcode 进行存档时,有必要重建 iOS 应用程序。然而,在官方 Github 存储库上有一个关于引入直接从 Flutter 发布 IPA 文件的命令的讨论,但目前这是不可能的。
我的问题是 - 有没有什么方法可以缩短这个构建时间,例如通过跳过 fastlane 步骤中的构建,只是将 .app 文件辞职并存档到 .ipa?我不能自己让它工作。
在这里,你可能会发现一个样品扑应用与cloud_firestore功能。
您可以在下面找到我的 Bitrise 和 fastlane 配置:
---
format_version: '7'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: flutter
trigger_map:
- push_branch: master
workflow: test
workflows:
prepare:
steps:
- activate-ssh-key@4.0.3:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- set-env-var@0.9.1:
title: APP_NAME
inputs:
- destination_keys: APP_NAME
- value: pl.flutter.buildTimeIssue
- set-env-var@0.9.1:
title: FL_BUILD_NUMBER
inputs:
- destination_keys: FL_BUILD_NUMBER
- value: "$BITRISE_BUILD_NUMBER"
- set-env-var@0.9.1:
title: FL_VERSION_NUMBER
inputs:
- destination_keys: FL_VERSION_NUMBER
- value: 0.1.$BITRISE_BUILD_NUMBER
- git-clone@4.0.14: {}
- cache-pull: {}
- recursive-touch@0.9.0: {}
- flutter-installer:
inputs:
- version: v1.2.1
- script@1.1.5:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
cd $BITRISE_FLUTTER_PROJECT_LOCATION/ios
pod repo update
title: Update pods repository
test:
before_run:
- prepare
steps:
- flutter-build@0.9.2:
inputs:
- project_location: "$BITRISE_FLUTTER_PROJECT_LOCATION"
- ios_additional_params: "--release --no-codesign -t lib/main.dart
--build-name=$FL_VERSION_NUMBER --build-number=$FL_BUILD_NUMBER"
is_always_run: true
- fastlane@2.4.0:
title: fastlane iOS
inputs:
- work_dir: "$BITRISE_FLUTTER_PROJECT_LOCATION/ios"
- lane: ios test
after_run:
- finish
envs:
- opts:
is_expand: false
FLAVOR: tst
- opts:
is_expand: false
TARGET_FILE: main_tst
finish:
steps:
- cache-push@2.1.1:
inputs:
- ignore_check_on_paths: "~/Library/Developer/Xcode/DerivedData"
- cache_paths: |-
$BITRISE_FLUTTER_PROJECT_LOCATION/build
$BITRISE_FLUTTER_PROJECT_LOCATION/ios/Pods
~/Library/Developer/Xcode/DerivedData
app:
envs:
- opts:
is_expand: false
BITRISE_FLUTTER_PROJECT_LOCATION: ./
- opts:
is_expand: false
BITRISE_PROJECT_PATH: ./ios/Runner.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: tst
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: ad-hoc
Run Code Online (Sandbox Code Playgroud)
这是快速通道:
default_platform(:ios)
platform :ios do
lane :test do
match(
type: "adhoc",
force_for_new_devices: true,
)
automatic_code_signing(
use_automatic_signing: false
)
update_project_provisioning(
profile: ENV["sigh_pl.flutter.buildTimeIssue_adhoc_profile-path"],
build_configuration: "Release",
code_signing_identity: "iPhone Distribution"
)
build_app(
scheme: "tst",
configuration: "Release",
xcargs: "-allowProvisioningUpdates",
export_options: {
signingStyle: "manual",
method: "ad-hoc",
provisioningProfiles: {
"pl.flutter.buildTimeIssue": "match AdHoc pl.flutter.buildTimeIssue"
}
},
output_name: "Runner.ipa"
)
appcenter_upload(
app_name: "Name",
owner_name: "Owner",
group: "All-users-of-Name",
ipa: "Runner.ipa"
)
end
end
Run Code Online (Sandbox Code Playgroud)
我遇到了同样的问题,我使用https://github.com/invertase/firestore-ios-sdk-frameworks的 Cloud Firestore 框架的预编译二进制文件修复了这一问题,如下所示:
# ...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '6.26.0'
# ...
end
Run Code Online (Sandbox Code Playgroud)
完整的说明可以在这里找到https://github.com/FirebaseExtended/flutterfire/issues/2751