algolia / instantsearch-ios

⚡️ A library of widgets and helpers to build instant-search applications on iOS.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/ios/
Apache License 2.0
592 stars 55 forks source link

Xcode 12.5 (Fastlane) Archive Fails #172

Closed Sam-Spencer closed 3 years ago

Sam-Spencer commented 3 years ago

Describe the bug 🐛 Building fails with "unknown type" errors (see screenshot) that suggest the compiler doesn't realize you're referencing SwiftUI for some reason. While this seems like it might be a compiler bug, an easy fix is to add import SwiftUI statements to any files requiring it.

To Reproduce 🔍 Steps to reproduce the behavior:

  1. Attempt to archive a build via Fastlane including this project vis SPM.
  2. Building and archiving fails.

Expected behavior 💭 Builds should succeed.

Screenshots 🖥

Screen Shot 2021-05-08 at 6 44 22 PM

Environment:

jwells89 commented 3 years ago

I'm seeing this behavior as well with manual archiving. Debug builds targeting the simulator and physical devices build fine. Have tried versions of InstantSearch from 7.6.2 up to 7.11.0 to no avail.

Environment

mschinis commented 3 years ago

I just ran into the same issue as above. Building for distribution via fastlane.

Environment

Screenshot for reference

Screenshot 2021-05-18 at 16 05 15
Sam-Spencer commented 3 years ago

Found a temporary workaround when using fastlane or any automated xcodebuild system:

  1. Clean your build prior to beginning a new one
  2. Prior to building run the following in your project directory:

    Dir.chdir("../") do
      sh("xcodebuild","-resolvePackageDependencies")
    end
  3. Build and archive.

    IMO, this type of workaround shouldn’t be necessary. But it might indicate an issue with SPM and Xcode rather than algolia!

VladislavFitz commented 3 years ago

Thank you for reporting this. The fix is in progress. In the meantime feel free to downgrade to 7.10 as 7.11 only introduces the SwiftUI components.

alelordelo commented 3 years ago

Also ran into this issue when archiving.

Downgrading to 7.10.0 have me 20 errors (instead of 5 on 7.11).

My implementation is exactly the same as Algolia SwiftUI tutorial

VladislavFitz commented 3 years ago

@alelordelo The 7.11.1 patch is available via SPM (will be available later via Cocoapods as well). Please try it and confirm if it fixes the issues.

alelordelo commented 3 years ago

thanks, will test now via SPM

alelordelo commented 3 years ago

yup, worked! thanks for the quick reply mate!