RodrigoSMarques / flutter_branch_sdk

Flutter Plugin for create deep link using Branch Metrics SDK. This plugin provides a cross-platform (iOS, Android, Web).
https://branch.io
MIT License
100 stars 90 forks source link

Fatal error: Unexpectedly found nil while unwrapping an Optional value - flutter_branch_sdk: ^6.9.0 #258

Closed cardevisi closed 1 year ago

cardevisi commented 1 year ago

Describe the bug I'm trying to build a Flutter application for IOS, but I received this error. More details below:

flutter_branch_sdk/SwiftFlutterBranchSdkPlugin.swift:311: Fatal error: Unexpectedly found nil while unwrapping an Optional value

To Reproduce Steps to reproduce the behavior:

  1. After pod install and melos update
  2. I ran fvm flutter run
  3. When the application was initialized in the simulator
  4. See error

Or the alternative way Steps to reproduce the behavior:

  1. After pod install and melos update
  2. I try to build directly in xcode

Expected behavior I would like build without any problems.

Screenshots image

IOS Simulator:

RodrigoSMarques commented 1 year ago

I cannot reproduce the problem. I need more details.

I note that the error occurred in the FlutterBranchSdk.trackContent method.

I need the code example that you are using to initialize the BranchUniversalObject and that you are passing to the method.

Are you passing just one item or a Buo list?

cardevisi commented 1 year ago

Hi @RodrigoSMarques , thanks a lot! This is the way that we implemented the trackContent call. But after your comment we call another method FlutterBranchSdk.trackContentWithoutBuo and the problem solved.

image

New call:

image