Open sumittiware opened 7 months ago
Thank you for the report.
Without seeing the exception message, it's hard to know what is the cause of this. The getProductName
method inside of the SDK looks like this:
/**
* @return The human-readable name of the audio device.
*/
public CharSequence getProductName() {
String portName = mPort.name();
return (portName != null && portName.length() != 0) ? portName : android.os.Build.MODEL;
}
I guess it could be a NullPointerException
if mPort
is null. It would be strange if this were null, though. Since I can't reproduce it, you would have to do some debugging on your end. For example, you could add a println in the code just before the call to device.getProductName()
to print out device.getPort()
and see if it is null. If that's the cause, I can fix it.
Thank you for the response! Since the issue is not reproducible in my end either, it is getting reported on our firebase-crashlytics dashboard, not sure if this will work, but will try this.
If you could get the exception message as well, that would be helpful.
Taking a second look, audio_session calls device.getId()
first without crashing, and getId()
should theoretically trigger the same NPE since it accesses a member of mPort
. So that would suggest mPort
is not the problem, although then I have no more clues on what the error is pointing to.
Aside from the error, I'm also suspicious that an error on this line could cause an ANR. One theory is that the cause of the ANR is elsewhere, then the app gets killed, and then this stack trace happens to just reveal what audio_session was doing at the time the app was killed, without that audio_session's activity itself being blocking in any way. That could also explain why there is no exception message.
We are using the dependency to record the audio, we have noticed that it causing an ANR in the background with the following stack trace.
Dependency version : audio_session: ^0.1.13 Device : Redmi 9 Power Android version : 12 Flutter doctor :
Stacktrace
Couldn’t reproduce the issue locally as there was no Flutter/dart associated stacktrace.