Skip to content

Commit d43a061

Browse files
committed
fix: clean stale native asset state before iOS/macOS CI builds
The .dart_tool directory is cached by pubspec.lock hash, but it contains native asset build metadata (NativeAssetsManifest.json) that references compiled .dylibs in build/native_assets/ which is not cached. When a cache hit restores stale .dart_tool state, xcode_backend.dart fails trying to copy the missing objective_c native asset. Clearing flutter_build and native_assets before building forces a fresh native asset compilation.
1 parent 05fe821 commit d43a061

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ jobs:
236236
- name: Update CocoaPods repo
237237
run: pod repo update
238238

239+
- name: Clean native asset build state
240+
run: |
241+
rm -rf build/native_assets
242+
rm -rf .dart_tool/flutter_build
243+
239244
- name: Build iOS
240245
run: flutter build ios --release --no-codesign "${{ env.DART_DEFINES }}" -v
241246

@@ -315,6 +320,11 @@ jobs:
315320
- name: Update CocoaPods repo
316321
run: pod repo update
317322

323+
- name: Clean native asset build state
324+
run: |
325+
rm -rf build/native_assets
326+
rm -rf .dart_tool/flutter_build
327+
318328
- name: Build macOS (no-sandbox for distribution)
319329
run: |
320330
# Configure ad-hoc signing for CI (no developer certificate available)

0 commit comments

Comments
 (0)