Flutter Plugin failed to initialize - unable to establish connection

Hi all,

I am testing Dynatrace Flutter Plugin with VS Code, I followed step by

  1. Create Flutter Project
  2. Run “flutter pub add dynatrace_flutter_plugin”
  3. download the configuration dynatrace.config.yaml. Store it in the root folder
  4. Include “import ‘package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart’; void main() => Dynatrace().start(MyApp());” in to main.dart code
  5. Run dart run dynatrace_flutter_plugin in the root of your Flutter project
  6. Call flutter run and the application starts including Dynatrace OneAgent

Then I found error below

------------------------------------------------

A Dart VM Service on Chrome is available at: http://127.0.0.1:57149/NFDnX6zcZuo=

[2024-12-02 12:48:38][ERROR][DYNATRACE]: Dynatrace Flutter Plugin failed to initialize. Error: PlatformException(channel-error, Unable to establish connection on

channel., null, null)

-----------------------------------------------

What I have missed step that need to run the plugin? Thank you.

Hi, Could you please share what version of Dynatrace Flutter Plugin are you using?

Hi, AndriiKh

I am using version 3.303.1

Okay, as a quick fix I would suggest to try to downgrade to version 3.299.1. We will investigate the issue on 3.303.1. What is platform causing the problem (Android/iOS/both)? And can you maybe share content of your dynatrace.config.yaml?

I am trying for Andriod. Here is my dynatrace.config.yaml

HI, @Lextech. Are you able to reproduce the issue with other version of dynatrace flutter plugin? And other question do you have any custom logic within your MainActivity, or GeneratedPluginRegistrant?

Hi @Lextech! Did you find the solution for this one? :slightly_smiling_face:

Hi, I solved this one after I selected correct Android phone emulator from VS code, not select any web browse or desktop