You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. thank you for the great package.
I have a custom event function which calls the recordCustomEvent function of NewRelicMobile, and I get this exception when the eventAttributes map is null.
E/MethodChannel#newrelic_mobile( 5164): java.lang.NullPointerException: null cannot be cast to non-null type java.util.HashMap<*, *>{ kotlin.collections.TypeAliasesKt.HashMap<*, *> }
E/MethodChannel#newrelic_mobile( 5164): at com.newrelic.newrelic_mobile.NewrelicMobilePlugin.onMethodCall(NewrelicMobilePlugin.kt:141)
E/MethodChannel#newrelic_mobile( 5164): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#newrelic_mobile( 5164): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#newrelic_mobile( 5164): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#newrelic_mobile( 5164): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#newrelic_mobile( 5164): at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#newrelic_mobile( 5164): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#newrelic_mobile( 5164): at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#newrelic_mobile( 5164): at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#newrelic_mobile( 5164): at android.app.ActivityThread.main(ActivityThread.java:7918)
E/MethodChannel#newrelic_mobile( 5164): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#newrelic_mobile( 5164): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#newrelic_mobile( 5164): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
I believe this is the line of the plugin native code which causes this exception:
// NewrelicMobilePlugin.kt"recordCustomEvent"-> {
val eventType:String?= call.argument("eventType")
val eventName:String?= call.argument("eventName")
val eventAttributes:HashMap<String, Any>?= call.argument("eventAttributes")
val copyOfEventAttributes = eventAttributes?.clone() asHashMap<*, *>; // <-- causing exceptionfor (key in copyOfEventAttributes.keys) {
val value = copyOfEventAttributes[key]
if(value isHashMap<*, *>) {
for (k in value.keys) {
value[k]?.let { eventAttributes.put(k asString, it) };
}
eventAttributes.remove(key)
}
}
val eventRecorded =NewRelic.recordCustomEvent(eventType, eventName, eventAttributes)
result.success(eventRecorded)
}
Hi. thank you for the great package.
I have a custom event function which calls the
recordCustomEvent
function ofNewRelicMobile
, and I get this exception when theeventAttributes
map is null.I believe this is the line of the plugin native code which causes this exception:
here is my code:
My environment is:
Flutter 3.16.9
NewRelicMobile 1.0.2
agent-gradle-plugin 6.5.0
The text was updated successfully, but these errors were encountered: