aws-samples / amazon-ivs-player-android-sample

This repository contains sample apps which use the IVS Player Android SDK.
https://docs.aws.amazon.com/ivs/
MIT No Attribution
28 stars 8 forks source link

1.2.0 Regression -> Crash on network type change on android 11 #6

Closed rjaylwar closed 3 years ago

rjaylwar commented 3 years ago

When you try and connect on a non-wifi connection the IVS player crashes.

Likely Cause: Probably related to the android 11 behavior changes for the TelephonyManager#getDataNetworkType() method which requires the Manifest.permission.READ_PHONE_STATE permission. https://developer.android.com/reference/android/telephony/TelephonyManager#getNetworkType()

This is a regression because the crash does not occur in version 1.0.0 but it does occur in version 1.2.0.

CRASH LOG: A/com.ivsapp: java_vm_ext.cc:577] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.SecurityException: getDataNetworkTypeForSubscriber java_vm_ext.cc:577] at java.lang.Exception android.os.Parcel.createExceptionOrNull(int, java.lang.String) (Parcel.java:2373) java_vm_ext.cc:577] at java.lang.Exception android.os.Parcel.createException(int, java.lang.String) (Parcel.java:2357) java_vm_ext.cc:577] at void android.os.Parcel.readException(int, java.lang.String) (Parcel.java:2340) java_vm_ext.cc:577] at void android.os.Parcel.readException() (Parcel.java:2282) java_vm_ext.cc:577] at int com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(int, java.lang.String, java.lang.String) (ITelephony.java:8762) java_vm_ext.cc:577] at int android.telephony.TelephonyManager.getNetworkType(int) (TelephonyManager.java:3021) java_vm_ext.cc:577] at int android.telephony.TelephonyManager.getNetworkType() (TelephonyManager.java:2985) java_vm_ext.cc:577] at com.amazonaws.ivs.net.NetworkLinkInfo$CellularNetworkType com.amazonaws.ivs.net.NetworkLinkInfo.getCellularNetworkType() (NetworkLinkInfo.java:97) java_vm_ext.cc:577] at java.lang.String com.amazonaws.ivs.net.NetworkLinkInfo.getNetworkType() (NetworkLinkInfo.java:70) java_vm_ext.cc:577] java_vm_ext.cc:577] in call to CallObjectMethodV A/com.ivsapp: runtime.cc:655] Runtime aborting...

maxstoller commented 3 years ago

Hi @rjaylwar, thanks for reporting this issue. We are working on a fix now with a target release date of next week. In the meantime, if possible, we recommend targeting a previous Android API level. As you mentioned, this issue only occurs on Android 11. Thanks again.

maxstoller commented 3 years ago

We released a fix for this in 1.2.1: https://docs.aws.amazon.com/ivs/latest/userguide/IVSPRN.html

Thanks again for reporting this issue.