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

Cannot build iOS app since updating to 3.2.x #133

Closed
biklas7 opened this issue Dec 9, 2024 · 16 comments
Closed

Cannot build iOS app since updating to 3.2.x #133

biklas7 opened this issue Dec 9, 2024 · 16 comments

Comments

@biklas7
Copy link

biklas7 commented Dec 9, 2024

After updating my adapty dependency and making the necessary changes, when I try to build my app on iOS I get errors. See attached logs.
logs.txt

@x401om
Copy link
Collaborator

x401om commented Dec 9, 2024

Hi @biklas7! Please kindly share your flutter doctor output and Cocoapods version you are using

@biklas7
Copy link
Author

biklas7 commented Dec 9, 2024

Sure!

Cocoapods version: 1.16.2

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.1.1 24B91 darwin-arm64, locale en-PT)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

@x401om
Copy link
Collaborator

x401om commented Dec 9, 2024

@biklas7 I believe there might be an issue with your plugin integration. Could you please ensure that you have properly updated the plugin and run pod install or pod update Adapty? I also recommend cleaning the Derived Data and the build folder.

@biklas7
Copy link
Author

biklas7 commented Dec 9, 2024

@x401om I just tried doing what you've suggested and still it does not build 😢

@biklas7
Copy link
Author

biklas7 commented Dec 9, 2024

I suspected this issue happens because you guys updated to Swift 6 or something like that and are now also using Swift Package Manager, but I also tried updating flutter to main channel and enable the Swift Package Manager and it also does not work.

The only way it works for us is to revert to version 2.x unfortunately.

@x401om
Copy link
Collaborator

x401om commented Dec 9, 2024

@biklas7 Updating our SDK to Swift 6 does not require you to update the Swift version of your project. In the file you attached in the original message, I noticed numerous errors, which I suspect may be related to incorrect dependency resolution.

By the way, we support CocoaPods as the primary distribution channel for our cross-platform SDKs, at least until Flutter fully transitions to SPM. However, I’m not entirely sure if it currently works with SPM.

Could you please try running our example app included with version 3.2.3? Are there any issues with it?

@PBomermustekiin
Copy link

PBomermustekiin commented Dec 10, 2024

flutter upgrade (update your flutter)
flutter clean,
flutter pub get,
cd ios
pod install
pod update Adapty

@biklas7
Copy link
Author

biklas7 commented Dec 10, 2024

flutter upgrade (update your flutter) flutter clean, flutter pub get, cd ios pod install pod update Adapty

@PBomermustekiin obviously that was the first thing I tried. It didn't work.

@biklas7 Updating our SDK to Swift 6 does not require you to update the Swift version of your project. In the file you attached in the original message, I noticed numerous errors, which I suspect may be related to incorrect dependency resolution.

By the way, we support CocoaPods as the primary distribution channel for our cross-platform SDKs, at least until Flutter fully transitions to SPM. However, I’m not entirely sure if it currently works with SPM.

Could you please try running our example app included with version 3.2.3? Are there any issues with it?

@x401om sorry didn't have time yet to try the example, will try as soon as possible and get back to you.

@biklas7
Copy link
Author

biklas7 commented Dec 11, 2024

@x401om It does build with the example app 🤔 so weird, do you have hints on how I can try solving this issue?

@x401om
Copy link
Collaborator

x401om commented Dec 11, 2024

@biklas7 Please take some screenshots of your Xcode showing the errors and email them to agoncharov_at_adapty.io. I will try to help.

@berkansevimli
Copy link

berkansevimli commented Dec 11, 2024

Same issue:


Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Xcode build done.                                           47,5s
Failed to build iOS app
Swift Compiler Error (Xcode): Call to main actor-isolated initializer 'init(_:additionalPadding:drawDecoratorBackground:)' in a synchronous nonisolated context
/Volumes/Disk/env/myApp/ios/Pods/AdaptyUI/AdaptyUI/Rendering/Elements/AdaptyUIElementView.swift:97:12

Swift Compiler Error (Xcode): Call to main actor-isolated initializer 'init(_:additionalPadding:drawDecoratorBackground:)' in a synchronous nonisolated context
/Volumes/Disk/env/myApp/ios/Pods/AdaptyUI/AdaptyUI/Rendering/Templates/AdaptyUIFlatContainerView.swift:29:16

Swift Compiler Error (Xcode): Call to main actor-isolated initializer 'init(_:additionalPadding:drawDecoratorBackground:)' in a synchronous nonisolated context
/Volumes/Disk/env/myApp/ios/Pods/AdaptyUI/AdaptyUI/Rendering/Templates/AdaptyUIFlatContainerView.swift:33:12

Swift Compiler Error (Xcode): Cannot find 'onGeometryChange' in scope
/Volumes/Disk/env/myApp/ios/Pods/AdaptyUI/AdaptyUI/Rendering/Modifiers/AdaptyUIGeometrySizeObserver.swift:45:12

Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro Max.


Exited (1).

@x401om
Copy link
Collaborator

x401om commented Dec 12, 2024

@berkansevimli which Xcode and Swift version are you using for this project?

@berkansevimli
Copy link

@x401om Flutter doctor:

[✓] Flutter (Channel stable, 3.22.0, on macOS 14.1 23B74 darwin-arm64, locale tr-TR) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.1) [✓] VS Code (version 1.90.2) [✓] Connected device (5 available) [✓] Network resources

pod --version 1.16.2

@biklas7
Copy link
Author

biklas7 commented Dec 12, 2024

Was able to finally find the cause of my issue thanks to @x401om

It was actually a "clash" with the ar_kit_plugin package that has this in their readme https://pub.dev/packages/arkit_plugin#before-you-go-to-appstore.

So replacing:
config.build_settings['OTHER_SWIFT_FLAGS'] = '-DDISABLE_TRUEDEPTH_API'
With:
config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -DDISABLE_TRUEDEPTH_API'

Solved everything 👍

@x401om
Copy link
Collaborator

x401om commented Dec 12, 2024

@biklas7 I even came across an open issue about that: olexale/arkit_flutter_plugin#225
I think it would be better if they included $(inherited) in their instructions, as many libraries define their flags.

@berkansevimli I believe your issue is related to the Xcode version you are using (15.0.1). I will prepare a fix for that, but please consider updating Xcode when possible, as Apple typically stops accepting builds made with older Xcode versions around April or May.

@x401om
Copy link
Collaborator

x401om commented Dec 13, 2024

@berkansevimli please update to 3.2.4

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

No branches or pull requests

4 participants