Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Android Paho client on Andriod OS 8 (Oreo) issue

Dear all,

I am using the library org.eclipse.paho.client ( to implement a simple Android MQTT client which connects to our MQTT server.


My Android MQTT client application worked properly until Android OS 7.x.  Unfortunately, it is not working properly for Android 8 (Oreo version). Specifically, I received the following exceptions:


· has leaked ServiceConnection$MyServiceConnection@4058b04 that was originally bound here


· Service has leaked IntentReceiver$AlarmReceiver@b9978a0 that was originally registered here. Are you missing a call to unregisterReceiver()?


·         java.lang.IllegalStateException: Not allowed to start service Intent { cmp= }: app is in background uid UidRecord {61f9870 …………………}


I followed the recommendations from Google for Androdi 8.0 ( and ) , so I changed my class to extend JobIntentService and use the enqueueWork().

In the MainActivity’s onCreate()  I am calling the JobIntentService as following:


Intent intentService = new Intent(MainActivity.this, SimpleJobIntentService.class);
"label", intentService.toString());

this, intentService);

new Intent(this, SimpleJobIntentService.class));
else {
new Intent(this, SimpleJobIntentService.class));


where the SimpleJobIntentService is calling the MQTT connection (MqttConnectOptions)

I am using the paho library in

 implementation('') {

        exclude module: 'support-v4'



I would like to ask you if there is any solution to this problem or if there is any newer version which is compliant with Android OS 8 (Oreo).




Back to the top