AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK

6.6.3 blocks both SwiftPM (iOS/macOS) and AGP 9.x (Android) — root cause + verified fix for the SwiftPM half

Open
#2,687 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
795
Forks
448
Avg merge
12h 19m
Merged PRs (30d)
14

Description

### Summary

`agora_rtc_engine` 6.6.3 blocks two separate parts of the modern Flutter toolchain at once. Filing them together because a project hitting one usually hits the other, and both point the same way: the plugin is pinned to an older build system than the one Flutter now defaults to.

1. **iOS / macOS — SwiftPM cannot compile.** The SwiftPM manifest pins a different, older Iris wrapper than the podspec, and that wrapper does not ship `AgoraPIPController.h`.
2. **Android — AGP 9.x cannot build.** Duplicate `io.agora.rtc` namespace across the bundled native modules.

---

## 1. iOS / macOS — SwiftPM build failure

The iOS SwiftPM manifest pins a **different, older Iris wrapper** than the podspec does, and that wrapper does not ship `AgoraPIPController.h`. Any SwiftPM build therefore fails at compile time, while the CocoaPods build of the same version succeeds.

This is the root cause behind the symptom reported in #2626, and it is what PR #2633 sets out to fix. Filing it separately because #2626 has no diagnosis attached and the only workaround offered there is "disable SwiftPM".

### Environment

`agora_rtc_engine: 6.6.3` (latest on pub.dev) · Flutter 3.47.1 · Xcode 26 · macOS 26.

### Platforms affected

- [x] Android
- [x] iOS
- [x] macOS
- [ ] Windows
- [ ] Web

### The mismatch

`ios/agora_rtc_engine/Package.swift`:

```swift
.binaryTarget(
name: "AgoraRtcWrapper",
url: "https://download.agora.io/sdk/release/AgoraIrisRTC_iOS-4.5.2-build.1.zip",
checksum: "d5daaf4ef5a773c8710ac45fb72cc72b5a7757e3d63e3d58ced38fd9368de05e"
)
```

`ios/agora_rtc_engine.podspec`:

```ruby
s.dependency 'AgoraIrisRTC_iOS2', '4.6.2-build.1'
```

Note the package name differs — `AgoraIrisRTC_iOS` vs **`AgoraIrisRTC_iOS2`** — not just the version.

### Verification

I downloaded both archives and listed their headers.

`AgoraIrisRTC_iOS-4.5.2-build.1.zip` (used by SwiftPM) — **no `AgoraPIPController.h`**:

```
iris_rtc_c_api.h iris_rtc_rendering_c.h iris_rtc_rendering_cxx.h
iris_base.h iris_engine_base.h iris_platform.h
iris_module.h iris_rtc_high_performance_c_api.h
```

`AgoraIrisRTC_iOS2-4.6.2-build.1.zip` (used by CocoaPods) — **present**:

```
AgoraRtcWrapper.xcframework/ios-arm64/AgoraRtcWrapper.framework/Headers/AgoraPIPController.h
AgoraRtcWrapper.xcframework/ios-arm64_x86_64-simulator/AgoraRtcWrapper.framework/Headers/AgoraPIPController.h
```

Meanwhile `include/agora_rtc_engine/AgoraRtcNgPlugin.h:2` does:

```objc
#import
```

So the header the plugin imports only exists in the wrapper SwiftPM does *not* use.

There is a second, related inconsistency: `Package.swift` declares `.upToNextMajor(from: "4.5.2")` for `AgoraRtcEngine_iOS`, which resolves to **4.6.2**, while the binary wrapper stays pinned at 4.5.2 — so even the two SwiftPM dependencies are not aligned with each other.

### Suggested fix

Point the binary target at the same wrapper the podspec uses. Verified checksum:

```swift
.binaryTarget(
name: "AgoraRtcWrapper",
url: "https://download.agora.io/sdk/release/AgoraIrisRTC_iOS2-4.6.2-build.1.zip",
checksum: "eba8f9fc5b3d93d9d083d0c3f16e6c98fcd993e49989fb851e6df2941ca29825"
)
```

(Computed with `swift package compute-checksum` on the downloaded archive.)

PR #2633 already proposes this alignment and has been open since June. Given that Flutter enables SwiftPM by default now and warns that CocoaPods-only plugins "will become an error in a future version of Flutter", and that CocoaPods trunk goes read-only within about ten months, shipping this would unblock a growing number of projects.

### Impact

`agora_rtc_engine` cannot be used with SwiftPM at all. Disabling SwiftPM works, but it is not viable for projects that also depend on SwiftPM-only plugins — `sentry_flutter` 10.x, for instance, ships no podspec, so the two cannot coexist today.

---

## 2. Android — AGP 9.x build failure

Setting AGP to 9.x and Gradle to 9.x fails the manifest merger:

```
Namespace 'io.agora.rtc' is used in multiple modules and/or libraries:
io.agora.rtc:iris-rtc, io.agora.rtc:full-sdk, io.agora.rtc:full-rtc-basic,
io.agora.rtc:ains, io.agora.rtc:audio-beauty, io.agora.rtc:clear-vision,
io.agora.rtc:screen-capture, io.agora.rtc:spatial-audio, …
```

AGP 9 requires a unique namespace per module; the bundled Agora native artifacts all declare `io.agora.rtc`. Already reported in #2676 (open, 6.5.3 and 6.6.3 both affected).

The practical effect is that a project using `agora_rtc_engine` is held at **AGP 8.x / Gradle 8.x**, while Flutter 3.47 warns:

```
Flutter support for your project's Gradle version (8.14.3) will soon be dropped.
Please upgrade to at least 9.1.0 soon.
Flutter support for your project's Android Gradle Plugin version (8.11.1) will
soon be dropped. Please upgrade to at least 9.0.1 soon.
```

## Combined impact

Taken together, these pin a project to the previous generation of both build systems: CocoaPods on Apple platforms and AGP 8 on Android. Neither is a comfortable place to sit — CocoaPods trunk is scheduled to go read-only, Firebase stops publishing to CocoaPods after October 2026, and Flutter has announced it will drop support for AGP 8 and Gradle 8.

Happy to test patches against a production app that uses calls, live streaming, and screen sharing on both platforms.

## Related

- #2626 — iOS symptom, no root cause identified
- #2633 — PR proposing the SwiftPM fix, open since June
- #2676 — Android AGP 9.x namespace collision
- #2569 — separate macOS SwiftPM runtime issue

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.