element-hq / element-hq/element-ios

Build Error with newer Xcode/iOS SDKs: Use of private header from outside its module: 'netinet6/in6.h' in AFNetworking

Open
#8,027 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

### Description

When attempting to build the `element-ios` project using recent Xcode versions and newer iOS SDKs (e.g., iOS 18 / Simulator SDKs), the build fails during the dependency scanning phase of `AFNetworking`.

Clang throws a strict error regarding the usage of a private system header (`netinet6/in6.h`) inside `AFNetworkReachabilityManager.m` and `AFHTTPSessionManager.m`. Since `AFNetworking` is deprecated and no longer maintained upstream, this completely blocks the build pipeline on newer environment setups unless patched locally.

### Steps to Reproduce

1. Clone the `element-ios` repository on a machine running a recent Xcode version with newer iOS/Simulator SDKs.
2. Run `pod install`.
3. Build the `Riot` target for an iOS Simulator.

### Expected Behavior
The project should compile successfully without throwing module violation errors from third-party legacy dependencies.

### Actual Behavior & Logs

The compiler blocks the build with the following error logs:

```text
/Users/ais/iOSProjects/element-ios/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m:26:9: error: Use of private header from outside its module: 'netinet6/in6.h' (in target 'AFNetworking' from project 'Pods')

/Users/ais/iOSProjects/element-ios/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m:32:9: error: Use of private header from outside its module: 'netinet6/in6.h' (in target 'AFNetworking' from project 'Pods')

Contributor guide

Open the contributing guide

Research direction

Reproduce the simulator build after running pod install, then inspect Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m and AFHTTPSessionManager.m at the reported imports. Determine how the AFNetworking dependency is integrated before choosing a local fix. Done means the Riot target builds with recent Xcode and iOS SDKs without the private-header errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.