rtl_tcp_andro- icon indicating copy to clipboard operation
rtl_tcp_andro- copied to clipboard

Crash on Android 12 - Reason --> BinaryRunnerService.java

Open ebc81 opened this issue 2 years ago • 0 comments

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" />

ebc81 avatar Oct 29 '22 19:10 ebc81