Skip to content

[objective_c] 9.6.1 hook uses Architecture.arm64e, which no published code_assets has #3640

Open

Description

@yanashenyang

objective_c 9.6.1 (published 2026-09-15) fails to compile its build hook for
every downstream consumer, breaking all iOS/macOS builds of any app that
transitively depends on it (e.g. via path_provider_foundation).

Error

../../../.pub-cache/hosted/pub.dev/objective_c-9.6.1/hook/build.dart:222:16: Error: Member not found: 'arm64e'.
  Architecture.arm64e: 'arm64e-apple-darwin',
               ^^^^^^
../../../.pub-cache/hosted/pub.dev/objective_c-9.6.1/hook/build.dart:231:16: Error: Member not found: 'arm64e'.
  Architecture.arm64e: {
               ^^^^^^
Bad state: Generating kernel failed!

Building native assets for package:objective_c failed.
Compilation of hook returned with exit code: 254.
Target build_hooks failed: Error: Building native assets failed.

Cause

hook/build.dart in 9.6.1 uses Architecture.arm64e at lines 222 and 231-233:

final appleClangMacosTargetFlags = {
  Architecture.arm64: 'arm64-apple-darwin',
  Architecture.arm64e: 'arm64e-apple-darwin',   // line 222
  Architecture.x64: 'x86_64-apple-darwin',
};

final appleClangIosTargetFlags = {
  Architecture.arm64: {...},
  Architecture.arm64e: {                        // line 231
    IOSSdk.iPhoneOS: 'arm64e-apple-ios',
    IOSSdk.iPhoneSimulator: 'arm64e-apple-ios-simulator',
  },
  ...
};

But Architecture.arm64e does not exist in any published version of
code_assets. The latest release is 2.0.0 (2026-08-18), whose Architecture
only defines arm, arm64, ia32, riscv32, riscv64 and x64 — adding
arm64e is still tracked by the open issue #3379.

Meanwhile objective_c 9.6.1 declares:

dependencies:
  code_assets: ^2.0.0

which resolves to 2.0.0 for consumers, so the hook cannot compile.

This is masked inside the monorepo because objective_c's own pubspec carries:

dependency_overrides:
  code_assets:
    path: ../code_assets
  hooks:
    path: ../hooks

Those paths resolve to the unpublished in-repo versions that do have
arm64e. dependency_overrides are ignored for downstream consumers, so the
published constraint ^2.0.0 was never actually exercised before release.

For comparison, 9.6.0 is fine: it only mentions arm64e as a clang -arch
string literal, never as an Architecture member.

Reproduction

Any Flutter app with a transitive dependency on objective_c:

flutter build ipa

Or directly, without Flutter:

dart compile kernel --packages=.dart_tool/package_config.json \
  --output=/tmp/hook.dill \
  ~/.pub-cache/hosted/pub.dev/objective_c-9.6.1/hook/build.dart

Environment

  • Flutter 3.47.2 (stable), Dart 3.13.2, macOS
  • objective_c 9.6.1 — transitive, via path_provider_foundation 2.6.0
  • code_assets 2.0.0, hooks 2.0.0
  • iOS ad-hoc archive (flutter build ipa --export-method ad-hoc)

Workaround

dependency_overrides:
  objective_c: 9.6.0

Suggested fix

Either release code_assets with Architecture.arm64e (#3379) and bump
objective_c's constraint to require that version, or revert the arm64e
usage in the hook. Since 9.6.1 currently breaks the build of every consumer,
retracting it in the meantime would help.

It might also be worth adding a release check that resolves the package without
its dependency_overrides, so a constraint that only works inside the monorepo
cannot be published again.

Activity

  1. liamappelbe commented on Sep 15, 2026

    @liamappelbe
    Contributor

    Oops. I'll retract v9.6.1

    cc @dcharkes

  2. self-assigned this
    on Sep 15, 2026
  3. liamappelbe commented on Sep 15, 2026

    @liamappelbe
    Contributor

    Keeping this bug open to remind me to republish once the new code_assets is published

  4. liamappelbe commented on Sep 15, 2026

    @liamappelbe
    Contributor
  5. dcharkes commented on Sep 15, 2026

    @dcharkes
    Collaborator

    @liamappelbe Can we add a check to CI that catches us making mistakes like these?

    • e.g. should we enforce that the version listed in the pubspec.yaml is the one used? This would enforce us to flip everything to non-wip at the same time when publishing. (That might be okay, or might be too wieldy if we have 20+ packages being developed by different contributors concurrently.)
    • Or, can we add tests that if a package version is not WIP, it removes all dependency overrides and the resolution: workspace, does a pub get, and then dart analyze? This would validate the dependency bounds are high enough. (It wouldn't catch semantic breaking changes, but it would catch static breaking changes.)

    Any other ideas?

  6. liamappelbe commented on Sep 16, 2026

    @liamappelbe
    Contributor
    • Or, can we add tests that if a package version is not WIP, it removes all dependency overrides and the resolution: workspace, does a pub get, and then dart analyze?

    This sounds like the best approach to me.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions