Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on linking Mocker while building on device or archiving #75

Closed
AvdLee opened this issue Dec 10, 2020 · 8 comments
Closed

Issue on linking Mocker while building on device or archiving #75

AvdLee opened this issue Dec 10, 2020 · 8 comments

Comments

@AvdLee
Copy link
Contributor

AvdLee commented Dec 10, 2020

Hey Antoine! Hope you’re doing well. I’m using the Mocker library for unit testing API calls but I noticed the latest version causing build issues for device on Xcode 12 and when archiving. I get an error that a non-public symbol is being used for swift_FORCE_LOAD$_XCTestSwiftSupport, seems like it could be related to arm64 linking.

  • Integrated through SPM
  • Reverting back to 2.2.0 removed the issue

This is likely caused by the 2.3.0 release, more specifically this PR.

@AvdLee AvdLee added the bug label Dec 10, 2020
@cgoldammer
Copy link

cgoldammer commented Dec 28, 2020

I'm on Xcode 12.3: Getting the same issue on version 2.4.0 and 2.2.0 - I can build on simulators, but get the error above when building on my device (Iphone 11 pro). This might be part of a much larger issue: ReactiveX/RxSwift#2127.

@AvdLee
Copy link
Contributor Author

AvdLee commented Jan 4, 2021

I've not been able to find the cause of this. We're running the project on Xcode 12.3 without any issues, even on a device 🤔

@SeanMcTex
Copy link

I'm seeing the same issue, even building for simulator, using Xcode 12.2/12.3 and Mocker 2.4.0. Switching to Mocker 2.2.0 allowed my project to compile as well.

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

@rockylive
Copy link

I had the same issue. Switching to Mocker 2.2.0 fixed it

@AvdLee
Copy link
Contributor Author

AvdLee commented Aug 17, 2021

I had the same issue. Switching to Mocker 2.2.0 fixed it

I really wonder how this is happening to you. We're using the latest version of Mocker in all our projects at WeTransfer and we never run into this error.

Can you share which Xcode version you're using and how you integrated Mocker?

@nurkenn-keda
Copy link

nurkenn-keda commented Mar 18, 2023

@AvdLee

Can confirm it's still happening on my machine:

Spec:
CPU: M2
Xcode: 14.2
Alamofire: 5.6.4
Target: iPhone 14 Pro Simulator (arm64)

Reverting to Mocker 2.2.0 solved the issue
I used the tutorial in the Readme.md to integrate Mocker

func test_OK() {
        let configuration = URLSessionConfiguration.af.default
        configuration.protocolClasses = [MockingURLProtocol.self]
        let sessionManager = Alamofire.Session(configuration: configuration)
        
        
        let originalUrl: URL = URL(string: "Some URL")!
        let mock = Mock(url: originalUrl, contentType: .json, statusCode: 200, data: [.post: <Some Data here>])
        mock.register()
        
        let expectation = XCTestExpectation(description: "Create JSON")
        
        Task {
            // Call application code here //
        }
        wait(for: [expectation], timeout: 5.0)
}

@AvdLee
Copy link
Contributor Author

AvdLee commented Mar 22, 2023

@nurkenn-keda you've shared code that looks good. What issue are you actually facing?

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

No branches or pull requests

5 participants