rtl_tcp_andro-
rtl_tcp_andro- copied to clipboard
Crash on Android 12 - Reason --> BinaryRunnerService.java
Since you updated the Target API
I think you should start a foregroundservice instead of startservice.
public void startWithDevice(SdrDevice sdrDevice, SdrTcpArguments sdrTcpArguments) { Check.isNotNull(sdrDevice); Check.isNotNull(sdrTcpArguments); addWork(sdrDevice, sdrTcpArguments); if (!isRunning) { Intent intent = new Intent(getApplicationContext(), BinaryRunnerService.class); startService(intent); } else { closeService(); } }
so i think this would help
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(intent); } else startService(intent);
Additonal you should add in your AndroidManifest.xml
<service android:name="com.sdrtouch.rtlsdr.BinaryRunnerService" android:foregroundServiceType="connectedDevice" android:exported="false" />