[GH-ISSUE #56] Objective-C error 'Atlantis-Swift.h' file not found. #39

Open
opened 2026-03-03 19:11:12 +03:00 by kerem · 24 comments
Owner

Originally created by @apostopher on GitHub (Feb 10, 2021).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/56

Originally assigned to: @NghiaTranUIT on GitHub.

Hello,
first of all, thanks to proxyman, it's super easy to debug network traffic.

I'm trying to integrate Atlantis in my objective-C AppDelegate.m. but the Xcode build fails with the error 'Atlantis-Swift.h' file not found.

I followed the README.md documentation and added #import "Atlantis-Swift.h".
I'm using the Atlantis version 1.7.1 (installed using cocoapods)

Thanks in advance.

Originally created by @apostopher on GitHub (Feb 10, 2021). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/56 Originally assigned to: @NghiaTranUIT on GitHub. Hello, first of all, thanks to proxyman, it's super easy to debug network traffic. I'm trying to integrate Atlantis in my objective-C `AppDelegate.m`. but the Xcode build fails with the error `'Atlantis-Swift.h' file not found.` I followed the README.md documentation and added `#import "Atlantis-Swift.h"`. I'm using the Atlantis version 1.7.1 (installed using cocoapods) Thanks in advance.
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 10, 2021):

Thanks for the bug. Let me investigate it with the Objc Project

<!-- gh-comment-id:776373764 --> @NghiaTranUIT commented on GitHub (Feb 10, 2021): Thanks for the bug. Let me investigate it with the Objc Project
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 10, 2021):

Hey @apostopher

I've just created a new Objective-C Project and integrate Atlantis by Cocoapod. I didn't get any problem.

Screen Shot 2021-02-10 at 09 00 12
#import "AppDelegate.h"
#import "Atlantis-Swift.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [Atlantis startWithHostName:nil];
    return YES;
}

Can you download and run this objc example: https://www.dropbox.com/s/k9cbdqhmyil5lo6/Objective-C-Example.zip?dl=0

<!-- gh-comment-id:776377916 --> @NghiaTranUIT commented on GitHub (Feb 10, 2021): Hey @apostopher I've just created a new Objective-C Project and integrate Atlantis by Cocoapod. I didn't get any problem. <img width="1680" alt="Screen Shot 2021-02-10 at 09 00 12" src="https://user-images.githubusercontent.com/5878421/107453935-92549480-6b7e-11eb-94fe-d5285f5b4383.png"> ```objc #import "AppDelegate.h" #import "Atlantis-Swift.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [Atlantis startWithHostName:nil]; return YES; } ``` Can you download and run this objc example: https://www.dropbox.com/s/k9cbdqhmyil5lo6/Objective-C-Example.zip?dl=0
Author
Owner

@apostopher commented on GitHub (Feb 10, 2021):

@NghiaTranUIT thanks for a quick reply. sure. I'll try it on my end.

<!-- gh-comment-id:776417929 --> @apostopher commented on GitHub (Feb 10, 2021): @NghiaTranUIT thanks for a quick reply. sure. I'll try it on my end.
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 10, 2021):

You're welcome @apostopher Please let me know the result 😄

<!-- gh-comment-id:776428911 --> @NghiaTranUIT commented on GitHub (Feb 10, 2021): You're welcome @apostopher Please let me know the result 😄
Author
Owner

@apostopher commented on GitHub (Feb 10, 2021):

@NghiaTranUIT it worked in your project. I'm using react-native. and it's still failing. I'll investigate the issue and update this thread.

<!-- gh-comment-id:776484455 --> @apostopher commented on GitHub (Feb 10, 2021): @NghiaTranUIT it worked in your project. I'm using react-native. and it's still failing. I'll investigate the issue and update this thread.
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 10, 2021):

I'm not sure if Atlantis could work with React-Native if the Network library in your project doesn't use URLSession to make a Request.

Do you know a React-native example that I can test out? 🤔

<!-- gh-comment-id:776503734 --> @NghiaTranUIT commented on GitHub (Feb 10, 2021): I'm not sure if Atlantis could work with React-Native if the Network library in your project doesn't use URLSession to make a Request. Do you know a React-native example that I can test out? 🤔
Author
Owner

@apostopher commented on GitHub (Feb 10, 2021):

I think react-native's fetch API internally uses NSURLSession. I'll try a sample app tomorrow. I'll share my findings with you.

<!-- gh-comment-id:776803528 --> @apostopher commented on GitHub (Feb 10, 2021): I think react-native's fetch API internally uses NSURLSession. I'll try a sample app tomorrow. I'll share my findings with you.
Author
Owner

@apostopher commented on GitHub (Mar 12, 2021):

@NghiaTranUIT i investigated the issue and here are my 2 cents:
This error happens if the Podfile does not have use_frameworks! line.

Unfortunately in my case if i add use_frameworks! my other deps fail to build. :-(

<!-- gh-comment-id:797520751 --> @apostopher commented on GitHub (Mar 12, 2021): @NghiaTranUIT i investigated the issue and here are my 2 cents: This error happens if the `Podfile` does not have `use_frameworks!` line. Unfortunately in my case if i add `use_frameworks!` my other deps fail to build. :-(
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 13, 2021):

@apostopher can you fork the project, remove the use_frameworks! and see if it works for you 🤔

<!-- gh-comment-id:797861918 --> @NghiaTranUIT commented on GitHub (Mar 13, 2021): @apostopher can you fork the project, remove the `use_frameworks!` and see if it works for you 🤔
Author
Owner

@apostopher commented on GitHub (Mar 23, 2021):

@NghiaTranUIT I cloned this project https://www.dropbox.com/s/k9cbdqhmyil5lo6/Objective-C-Example.zip?dl=0 and tried without use_frameworks! and I can reproduce the same error.

<!-- gh-comment-id:804844415 --> @apostopher commented on GitHub (Mar 23, 2021): @NghiaTranUIT I cloned this project https://www.dropbox.com/s/k9cbdqhmyil5lo6/Objective-C-Example.zip?dl=0 and tried without `use_frameworks!` and I can reproduce the same error.
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 23, 2021):

Thanks. Let me check it out 👍

<!-- gh-comment-id:804964919 --> @NghiaTranUIT commented on GitHub (Mar 23, 2021): Thanks. Let me check it out 👍
Author
Owner

@archcorsair commented on GitHub (Nov 2, 2021):

Solution

🎉 I found a working solution using a plugin called cocoapods-user-defined-build-types

  1. Install the gem: $ gem install cocoapods-user-defined-build-types
  2. Add these above your target in Podfile
plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!
  1. Add atlantis pod:
pod 'atlantis-proxyman', :build_type => :dynamic_framework

This fixed my issue and Atlantis works perfectly.

Original Comment

I'm running into this exact issue.
I've confirmed the pod was installed, it shows up in Podfile.lock. atlantis-proxyman (1.12.0)
Tried cleaning before building and it did not help.

React Native project - Running on M1 (arm64)
Xcode 13.1 (13A1030d)
MacOS 12.0.1

image

<!-- gh-comment-id:958219373 --> @archcorsair commented on GitHub (Nov 2, 2021): # Solution 🎉 I found a working solution using a plugin called [cocoapods-user-defined-build-types](https://github.com/joncardasis/cocoapods-user-defined-build-types) 1. Install the gem: `$ gem install cocoapods-user-defined-build-types` 2. Add these above your target in `Podfile` ```ruby plugin 'cocoapods-user-defined-build-types' enable_user_defined_build_types! ``` 3. Add atlantis pod: ```ruby pod 'atlantis-proxyman', :build_type => :dynamic_framework ``` This fixed my issue and Atlantis works perfectly. # Original Comment I'm running into this exact issue. I've confirmed the pod was installed, it shows up in `Podfile.lock`. `atlantis-proxyman (1.12.0)` Tried cleaning before building and it did not help. React Native project - Running on M1 (arm64) Xcode 13.1 (13A1030d) MacOS 12.0.1 ![image](https://user-images.githubusercontent.com/1036921/139956962-bb3075e1-ed6a-40e5-8f64-965e6aabfe59.png)
Author
Owner

@archcorsair commented on GitHub (Nov 2, 2021):

Solution

🎉 I found a working solution using a plugin called cocoapods-user-defined-build-types

  1. Install the gem: $ gem install cocoapods-user-defined-build-types
  2. Add these two lines above your target in Podfile:
plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!
  1. Add atlantis pod:
pod 'atlantis-proxyman', :build_type => :dynamic_framework

This fixed my issue and Atlantis works perfectly.

<!-- gh-comment-id:958427958 --> @archcorsair commented on GitHub (Nov 2, 2021): # Solution 🎉 I found a working solution using a plugin called [cocoapods-user-defined-build-types](https://github.com/joncardasis/cocoapods-user-defined-build-types) 1. Install the gem: `$ gem install cocoapods-user-defined-build-types` 2. Add these two lines above your target in `Podfile`: ```ruby plugin 'cocoapods-user-defined-build-types' enable_user_defined_build_types! ``` 3. Add atlantis pod: ```ruby pod 'atlantis-proxyman', :build_type => :dynamic_framework ``` This fixed my issue and Atlantis works perfectly.
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 3, 2021):

Awesome 👍 I might add a public header to in SPM, so you can use SPM on Objective-C project 👍

<!-- gh-comment-id:958574196 --> @NghiaTranUIT commented on GitHub (Nov 3, 2021): Awesome 👍 I might add a public header to in SPM, so you can use SPM on Objective-C project 👍
Author
Owner

@apostopher commented on GitHub (Nov 3, 2021):

that's great news! thanks, @archcorsair for the solution. and a million thanks to @NghiaTranUIT for the awesome proxyman and atlantis!

do you have plans to support android too?

<!-- gh-comment-id:958582387 --> @apostopher commented on GitHub (Nov 3, 2021): that's great news! thanks, @archcorsair for the solution. and a million thanks to @NghiaTranUIT for the awesome proxyman and atlantis! do you have plans to support android too?
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 3, 2021):

Unfortunately, I don't have any plan to bring Atlantis to Android because I have no experience on Android and Atlantis is heavily depends on Method Swizzling and URLSession, which are not available on Android world.

<!-- gh-comment-id:958583137 --> @NghiaTranUIT commented on GitHub (Nov 3, 2021): Unfortunately, I don't have any plan to bring Atlantis to Android because I have no experience on Android and Atlantis is heavily depends on Method Swizzling and URLSession, which are not available on Android world.
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 3, 2021):

It seems that adding the public header to use SPM on the Objective-C project is not possible in terms of technical limitations. Thread: https://forums.swift.org/t/how-to-import-swift-package-into-objective-c-using-xcode/43978/15

<!-- gh-comment-id:958586500 --> @NghiaTranUIT commented on GitHub (Nov 3, 2021): It seems that adding the public header to use SPM on the Objective-C project is not possible in terms of technical limitations. Thread: https://forums.swift.org/t/how-to-import-swift-package-into-objective-c-using-xcode/43978/15
Author
Owner

@StanislavMayorov commented on GitHub (Aug 11, 2022):

Http proxy works fine in RN project using cocoapods-user-defined-build-types solution, but websocket doesn't work. Is it possible to extend RN implementation to support atlantis?

<!-- gh-comment-id:1212125685 --> @StanislavMayorov commented on GitHub (Aug 11, 2022): Http proxy works fine in RN project using cocoapods-user-defined-build-types solution, but websocket doesn't work. Is it possible to extend RN implementation to support atlantis?
Author
Owner

@rolfen commented on GitHub (Mar 14, 2024):

@archcorsair , followed your instructions, to no avail

[!] Invalid `Podfile` file: undefined method `enable_user_defined_build_types!' for an instance of Pod::Podfile
<!-- gh-comment-id:1997671749 --> @rolfen commented on GitHub (Mar 14, 2024): @archcorsair , followed your instructions, to no avail ``` [!] Invalid `Podfile` file: undefined method `enable_user_defined_build_types!' for an instance of Pod::Podfile ```
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 15, 2024):

@rolfen do you use React Native or native iOS app 🤔

I've created a Objective-C iOS project again, and Cocoapod works fine with Atlantis. No need to use enable_user_defined_build_types

<!-- gh-comment-id:1998844826 --> @NghiaTranUIT commented on GitHub (Mar 15, 2024): @rolfen do you use React Native or native iOS app 🤔 I've created a Objective-C iOS project again, and Cocoapod works fine with Atlantis. No need to use `enable_user_defined_build_types`
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 15, 2024):

Http proxy works fine in RN project using cocoapods-user-defined-build-types solution, but websocket doesn't work. Is it possible to extend RN implementation to support atlantis?

It's a known issue because React Native doesn't use native URLWebsocketSession to make a WS/WSS. They use their own WS socket. Thus, Atlantis doesn't work.

<!-- gh-comment-id:1998845330 --> @NghiaTranUIT commented on GitHub (Mar 15, 2024): > Http proxy works fine in RN project using cocoapods-user-defined-build-types solution, but websocket doesn't work. Is it possible to extend RN implementation to support atlantis? It's a known issue because React Native doesn't use native URLWebsocketSession to make a WS/WSS. They use their own WS socket. Thus, Atlantis doesn't work.
Author
Owner

@rolfen commented on GitHub (Mar 16, 2024):

@rolfen do you use React Native or native iOS app 🤔

I've created a Objective-C iOS project again, and Cocoapod works fine with Atlantis. No need to use enable_user_defined_build_types

I use react-native trying to build ios.

I tried the workaround suggested by @archcorsair and after many additional steps to be able to install the plugin (install rbenv, update ruby, update this update that, etc.) I finally hit this error on pod install so gave up on atlantis.

Flipper or proxyman(+helper) seem to work for my needs.

Changing the use_frameworks! setting will break the build somewhere else.

<!-- gh-comment-id:2001893177 --> @rolfen commented on GitHub (Mar 16, 2024): > @rolfen do you use React Native or native iOS app 🤔 > > I've created a Objective-C iOS project again, and Cocoapod works fine with Atlantis. No need to use `enable_user_defined_build_types` I use react-native trying to build ios. I tried the workaround suggested by @archcorsair and after many additional steps to be able to install the plugin (install rbenv, update ruby, update this update that, etc.) I finally hit this error on `pod install` so gave up on atlantis. Flipper or proxyman(+helper) seem to work for my needs. Changing the `use_frameworks!` setting will break the build somewhere else.
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 16, 2024):

Can you use SPM on your react-native app? @rolfen

I will checkout the react-native + Atlantis today

<!-- gh-comment-id:2001893376 --> @NghiaTranUIT commented on GitHub (Mar 16, 2024): Can you use SPM on your react-native app? @rolfen I will checkout the react-native + Atlantis today
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 16, 2024):

@rolfen I follow this solution and it works fine: https://github.com/ProxymanApp/atlantis/issues/56#issuecomment-958427958

Screenshot 2024-03-16 at 4 12 59 PM


Note: I don't use use_frameworks! in the Podfile

<!-- gh-comment-id:2001922842 --> @NghiaTranUIT commented on GitHub (Mar 16, 2024): @rolfen I follow this solution and it works fine: https://github.com/ProxymanApp/atlantis/issues/56#issuecomment-958427958 ![Screenshot 2024-03-16 at 4 12 59 PM](https://github.com/ProxymanApp/atlantis/assets/5878421/b4c5ca06-7b7e-44e1-adb7-6866920a665d) ---------- Note: I don't use `use_frameworks!` in the `Podfile`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#39
No description provided.