Skip to content

fix(darwin): change SPM to dynamically link the framework#359

Merged
wang-bin merged 2 commits into
wang-bin:masterfrom
jonafeucht:patch-1
Jun 3, 2026
Merged

fix(darwin): change SPM to dynamically link the framework#359
wang-bin merged 2 commits into
wang-bin:masterfrom
jonafeucht:patch-1

Conversation

@jonafeucht

@jonafeucht jonafeucht commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

With the introduction of SPM the framework gets statically linked resulting in:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'fvp.framework/fvp': dlopen(fvp.framework/fvp, 0x0001): tried: 'fvp.framework/fvp' (no such file),
'/usr/lib/fvp.framework/fvp' (no such file, not in dyld cache), 'fvp.framework/fvp' (no such file).

This PR changes this so that it gets dynamically linked and fixes the issue.

Devices tested:

  • iOS Simulator
  • Physical iPhone (Debug)
  • Physical iPhone (Release)
  • Physical Mac (Debug)
  • Physical Mac (Release)

With the introduction of SPM the framework gets statically linked resulting in '/usr/lib/fvp.framework/fvp' (no such file, not in dyld cache), 'fvp.framework/fvp' (no such file).

This PR changes this so that it gets dynamically linked and fixes this issue.

Devices tested:
- iOS Simulator
- Physical iPhone (Debug)
- Physical iPhone (Release)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Swift package configuration in 'darwin/fvp/Package.swift' to define the library as dynamic and link the 'Flutter' framework. The review feedback correctly identifies that unconditionally linking 'Flutter' will cause build failures on macOS, where the framework is named 'FlutterMacOS', and provides a code suggestion to conditionally link the appropriate framework based on the platform.

Comment thread darwin/fvp/Package.swift Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@wang-bin wang-bin merged commit 2e5bf1e into wang-bin:master Jun 3, 2026
@wang-bin

wang-bin commented Jun 3, 2026

Copy link
Copy Markdown
Owner

runs fine now. thanks.

@wang-bin

wang-bin commented Jun 3, 2026

Copy link
Copy Markdown
Owner

0.37.2 is published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants