fastlane/fastlane

call to main actor-isolated global function 'setupSnapshot(_:waitForAnimations:)' in a synchronous nonisolated context

pedro380085 opened this issue · 2 comments

New Issue Checklist

Issue Description

Using my Snapfile does not yield screenshots due to UITests.swift not working.

Command executed
Complete output when running fastlane, including the stack trace and command used
❌  /UITests/UITests.swift:36:9: call to main actor-isolated global function 'setupSnapshot(_:waitForAnimations:)' in a synchronous nonisolated context
    setupSnapshot(app)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

❌ /UITests/UITests.swift:41:9: call to main actor-isolated global function 'snapshot(_:waitForLoadingIndicator:)' in a synchronous nonisolated context

    snapshot("0-LandingScreen", waitForLoadingIndicator: false);
     ^

❌ /UITests/UITests.swift:46:9: call to main actor-isolated global function 'snapshot(_:waitForLoadingIndicator:)' in a synchronous nonisolated context

    snapshot("1-LandingScreen", waitForLoadingIndicator: false);
     ^

❌ /UITests/UITests.swift:51:9: call to main actor-isolated global function 'snapshot(_:waitForLoadingIndicator:)' in a synchronous nonisolated context

    snapshot("2-LandingScreen", waitForLoadingIndicator: false);
     ^

Environment

 fastlane installation at path:
/opt/homebrew/lib/ruby/gems/3.3.0/gems/fastlane-2.220.0/bin/fastlane
-----------------------------
[✔] 🚀 
fastlane 2.220.0
 

I get this issue on all runs since upgrading to Xcode 15.3.

It was an issue with my UITests.swift file, I added @MainActor to my testExample function and it worked.