27 Mar 2023 04:52 PM - last edited on 19 May 2023 03:54 PM by AgataWlodarczyk
I was unable to make Dynatrace work with the latest version from pub.dev.
I followed all the steps of the documentation, but I'm getting this error while starting the app:
I am pretty sure there is something wrong with the method channel implementation of the plugin.
java.lang.NullPointerException: Attempt to read from field 'boolean com.dynatrace.android.agent.conf.Configuration.autoStart' on a null object reference in method 'void com.dynatrace.android.agent.DynatraceMethodCallHandler.onMethodCall(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result)'
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at com.dynatrace.android.agent.DynatraceMethodCallHandler.onMethodCall(DynatraceMethodCallHandler.java:120)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at android.app.ActivityThread.main(ActivityThread.java:7872)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#dynatrace_flutter_plugin/dynatrace(26848): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Solved! Go to Solution.
28 Mar 2023 12:28 PM
Hi Rodrigo,
This error sounds like auto instrumentation didnt happen. Did you execute the CLI command, so your configuration gets written into the gradle file?
28 Mar 2023 12:54 PM
Hey Matthias, thanks for the reply.
I don't know whats that CLI command. I saw nothing about that on the Flutter Documentation here: https://pub.dev/packages/dynatrace_flutter_plugin
All i did was store the dynatrace yaml file on the root folder of the project like it was written in the documentation.
28 Mar 2023 02:30 PM
I meant the command "flutter pub run dynatrace_flutter_plugin".
28 Mar 2023 02:58 PM
OMG. I completed missed this step on the documentation. So sorry.
Now everything is working fine! Thanks a lot!