Closed MiroLiebschner closed 1 month ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi 👋 This error occurs when methods from the SDK have been called before the SDK has been configured. I'd recommend examining the places where this happens to ensure that the SDK is configured before it's in use.
In particular, I'd recommend configuring the SDK as early as possible in your app's lifetime to prevent running into this kind of issue.
Hi @MiroLiebschner, since this issue hasn't been updated for a while and Andy's reply is the correct solution here, I'm going to close it. If you're still having this issue or you have additional information to share, please feel free to reopen it and mention either Andy or myself.
Environment
flutter doctor
`Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-DE) [!] Android toolchain - develop for Android devices (Android SDK version 31.0.0) ✗ Could not determine java version [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 3.6) [✓] VS Code (version 1.84.2) [✓] VS Code (version 1.80.0-insider) [✓] Connected device (4 available) ! Error: Browsing on the local area network for iPhone von Katharina (4). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for iPhone von Miro. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources! Doctor found issues in 1 category.`
[ x] Version of
purchases-flutter
6.30.1[ ] Testing device version e.g.: iOS 15.5, Android API 30, etc.
iOS 17.5.1 (iPhone Pro Max) and multiple other iOS devices
In release mode and on testflight. Only sometimes (race-condition?).
`// // FatalErrorUtil.swift // PurchasesHybridCommon // // Created by Andrés Boedo on 4/20/22. // Copyright © 2022 RevenueCat. All rights reserved. //
import Foundation
enum FatalErrorUtil {
}
func fatalError(_ message: @autoclosure () -> String = "", file: StaticString = #fileID, line: UInt = #line) -> Never { FatalErrorUtil.fatalErrorClosure(message(), file, line) }
`
error message:
Thread 1: Fatal error: Purchases has not been configured. Please configure the SDK before calling this method
Describe the bug
The app crashes with a fatal error. This happens only on iOS and only in Release mode or on Testflight (debug mode runs fine).