react-native-callkeep
react-native-callkeep copied to clipboard
NoSuchMethodError: No super method onSilence() Android self-managed mode
Bug report
-
[x] I've checked the example to reproduce the issue.
-
Reproduced on:
-
[x] Android
-
[ ] iOS
Description
Hi, When you try to silence the call it crashes every time on Android 9. I debugged my app on Android Studio and found the issue where it occurs.
@Override
public void onSilence() {
super.onSilence(); <-- Here. Because in Android 9 there is no such super method like onSilence.
sendCallRequestToActivity(ACTION_ON_SILENCE_INCOMING_CALL, handle);
Log.d(TAG, "[VoiceConnection] onSilence called");
}
Is there any way to going around this or is this a bug and we should fix like checking OS version like this:
Build.VERSION.SDK_INT > Build.VERSION_CODES.P
Thanks in advance.
Steps to Reproduce
- RNCallKeep.displayIncomingCall(params)
- Push the volume down (silence) button
Versions
- Callkeep: 4.3.1
- React Native: 0.63.4
- iOS: -
- Android: 9
- Phone model: Samsung Galaxy S8
Logs
E/AndroidRuntime: FATAL EXCEPTION: main
Process: nl.voipzeker.unitephone, PID: 26730
java.lang.NoSuchMethodError: No super method onSilence()V in class Landroid/telecom/Connection; or its super classes (declaration of 'android.telecom.Connection' appears in /system/framework/framework.jar!classes2.dex)
at io.wazo.callkeep.VoiceConnection.onSilence(VoiceConnection.java:269)
at android.telecom.ConnectionService.silence(ConnectionService.java:1662)
at android.telecom.ConnectionService.access$1600(ConnectionService.java:91)
at android.telecom.ConnectionService$2.handleMessage(ConnectionService.java:922)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Working fix for this is here:
https://github.com/react-native-webrtc/react-native-callkeep/pull/537/files#diff-5bf14dd7c9519f053dd7c65d373334375a8cec00476eec049a3e25fa7d47cae4R278
However it's more of a debate a few changes PR - but you can lift that code change into a fork of your own to resolve this issue for now.