Question

My iOS simulatore crashes when I setDebugLogsEnabled for flutter

  • 23 February 2022
  • 11 replies
  • 297 views

Badge +5

In my app the first call is

 

await Purchases.setDebugLogsEnabled(true);

 

The app crashes after that.

 

Any suggestions on how to resolve that?


11 replies

Userlevel 5
Badge +8

Hi @Gokula Krishna

 

I’d love to help here. I’m going to need more information though: 

  • Which SDK version are you using? 
  • Could you share the error message / crash stacktrace? 
  • Could you share the output of the debug logs? 
  • Could you share the output of flutter doctor?

Badge +5

Thanks for the help @Andy ,

 

  • XCode - 12
  • Error message and debug logs- not possible as the simulator shuts off completely. Any suggestions on how to capture?
  • Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.2 21D5039d darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (3 available)

• No issues found!

 

Userlevel 5
Badge +8

@Gokula Krishna

It seems like your toolchain is set to use Xcode 13.2.1 based on that output, maybe you should try opening the project using the same Xcode version? I doubt that that’s the problem, but just in case. 

Could you tell us which version of purchases_flutter you’re using? 

Have you tried running the project directly from Xcode and not VS code? 

I think there might be an issue with the setup itself, perhaps removing and re-adding the SDK from scratch, then cleaning flutter cache might help? 

 

Badge +5

@Andy 

 

I have upgraded all the packages to latest version now

  • Purchases_flutter is `3.9.5`
  • I tried directly from Xcode and I see the output!
  • Should I proceed with re-setup?

 

For now I can use the XCode’s output for debugging. Thanks

 

Userlevel 5
Badge +8

Is it working now after setting debug logs? 

Badge +5

No, I am using XCode’s output to test currently.

Userlevel 5
Badge +8

@Gokula Krishna were you able to figure this out? 

Badge +5

@Andy no. Do you have any suggestion to try?

Userlevel 5
Badge +8

🧐 So it crashes only when running it through VS Code, but not Xcode? 

 

If that’s the case, I’d suggest upgrading to the latest version of dart / flutter and retrying, I hit something like this at one point and it solved it for my computer. Could you give it a shot? 

 

Let me know if I read this wrong and the issue isn’t that it’s crashing through VS Code but not Xcode

 

Badge +5

I upgraded flutter now. Still not showing

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.2 21D5039d darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

 

Userlevel 5
Badge +8

@Gokula Krishna Just to clarify, when you say “still not showing” does it mean that the debug logs don’t show, or are you getting a crash? 

Reply