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

Unhandled Exception #261

Closed pankaj541998 closed 11 months ago

pankaj541998 commented 1 year ago

Describe the bug PlatformException(error, Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?, null, android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

Smartphone (Please complete the following information. remove session if not platform):

Web (please complete the following information. remove session if not platform):

Continuously showing same Exception i run the your example also but getting error.

Unhandled Exception: PlatformException(error, Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.

Please check the Screen shot mention 👎

image

RodrigoSMarques commented 1 year ago

Hi @pankaj541998 What is the Android version of the test device? Below Android 6?

pankaj541998 commented 12 months ago

I am using Android version 13. And the device Model Name OnePlus 11R.

When i am using the device android version 12 or below its working fine.

RodrigoSMarques commented 12 months ago

@pankaj541998

I cannot reproduce the error.

I don't have a physical device with Android 13. I'm using the emulator.

Captura de Tela 2023-11-16 às 21 47 44

Is your project using FlutterActivity or FlutterFramentActivity?

pankaj541998 commented 12 months ago

The most recent or upcoming devices come equipped with the latest version. Consequently, how can we effectively utilize them? I currently employ FlutterActivity in my projects.

image

pankaj541998 commented 11 months ago

Sorry i can't understand, can you elaborate this.

RodrigoSMarques commented 11 months ago

hi @pankaj541998

I fixed the bug, but I need help testing the changes in different scenarios.

Can you help me with testing the new version before publishing it on pub.dev?

Update pubspec.yaml, according to the example below:

#flutter_branch_sdk: ^7.0.1
flutter_branch_sdk:
     git:
       url: https://github.com/RodrigoSMarques/flutter_branch_sdk.git
       ref: v7.0.2-dev

I'm waiting for the test results.

Thanks.

pankaj541998 commented 11 months ago

Sure, let me know what i have to do ? What you want me to just change the code provided above in your YAML file, right?

RodrigoSMarques commented 11 months ago

Sure, let me know what i have to do ? What you want me to just change the code provided above in your YAML file, right?

correct. you need to update pubspec.yaml to use a version that is available on Github and not on pub.dev.

Thanks.

RodrigoSMarques commented 11 months ago

Fixed in version 7.0.2