Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app crashes every time when launching in release mode #75

Open
matthewfx opened this issue Feb 8, 2024 · 7 comments
Open

Android app crashes every time when launching in release mode #75

matthewfx opened this issue Feb 8, 2024 · 7 comments

Comments

@matthewfx
Copy link

I have added new relic 1.0.6

When run in debug it works fine but when an aab or apk in release mode is made it crashes the app every single time when you launch it (on the splash screen).

I have Crashlytics too and that's what I see in logs there

Fatal Exception: java.lang.ExceptionInInitializerError
com.newrelic.agent.android.NullAgentImpl.getDeviceInformation (NullAgentImpl.java:4)
com.newrelic.agent.android.Agent.getDeviceInformation (Agent.java:4)
com.newrelic.agent.android.stats.StatsEngine$SupportabilityDecorator.lazyGet (StatsEngine.java)
com.newrelic.agent.android.stats.StatsEngine.s (StatsEngine.java:1)
com.newrelic.agent.android.NewRelic.enableFeature (NewRelic.java:23)
com.newrelic.newrelic_mobile.NewrelicMobilePlugin.onMethodCall (NewrelicMobilePlugin.java:1456)
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.a (MethodChannel.java:18)
io.flutter.embedding.engine.dart.DartMessenger.invokeHandler (DartMessenger.java:46)

Caused by java.lang.RuntimeException
Missing type parameter.
com.newrelic.agent.android.NullAgentImpl.getDeviceInformation (NullAgentImpl.java:4)
com.newrelic.agent.android.Agent.getDeviceInformation (Agent.java:4)
com.newrelic.agent.android.stats.StatsEngine$SupportabilityDecorator.lazyGet (StatsEngine.java)
com.newrelic.agent.android.stats.StatsEngine.s (StatsEngine.java:1)
com.newrelic.agent.android.NewRelic.enableFeature (NewRelic.java:23)
com.newrelic.newrelic_mobile.NewrelicMobilePlugin.onMethodCall (NewrelicMobilePlugin.java:1456)
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.a (MethodChannel.java:18)
io.flutter.embedding.engine.dart.DartMessenger.invokeHandler (DartMessenger.java:46)
io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0 (DartMessenger.java:46)

I have checked if I haven't missed anything from the setup but doesn't look like I have

@ndesai-newrelic
Copy link
Collaborator

@matthewfx which device are you using? can you share sample app where we can reproduce the issue? we have 500+ apps already in production with this agent.

@matthewfx
Copy link
Author

It happens on all devices and emulators. Our app is a pretty mature and big project so I'm guessing maybe there is a clash with some other dependencies. Its size makes it hard for me to build a sample app atm. Do you have any clues what theoretically might be causing NullAgentImpl.getDeviceInformation?

@ndesai-newrelic
Copy link
Collaborator

@matthewfx how are you starting your agent? can you share that?

@matthewfx
Copy link
Author

Sure:
I'm calling this

Future<void> _newRelicSetup(String appToken) async {
  final Config config = Config(accessToken: appToken);
  FlutterError.onError = NewrelicMobile.onError;
  await NewrelicMobile.instance.startAgent(config);
  NewrelicMobile.instance.recordCustomEvent('AppStarted');
}

among other things I call within runZonedGuarded closure.

@ndesai-newrelic
Copy link
Collaborator

ndesai-newrelic commented Feb 9, 2024

@matthewfx can you enable verbose logging and send agent logs ? please check do you call shutdown method anywhere in the code?

@matthewfx
Copy link
Author

Hi, I'm sorry but I went for a short holiday and only returned today. I will try to send it later this week.

@ndesai-newrelic
Copy link
Collaborator

@matthewfx any update on this one? can i close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants