14

I have an IntentService that is using android.support.v4.os.ResultReceiver to pass data. In the IntentService, when I use ResultReceiver.send method to send the result back, Android Studio shows an error saying

ResultReceiver.send can only be called from same library group (groupId=com.android.support)

I get a similar message while calling the constructor of ResultReceiver. But the code runs even with this error. This started showing up after I upgraded support library version to 25.1.1.

What am I supposed to do to get around this?

kp91
  • 1,168
  • 10
  • 14
  • That is because you need to extend this class. And in the new class, override the onReceiveResult() method. – zeekhuge Mar 14 '17 at 13:32
  • 3
    @ZeekHuge that is exactly what I have done. But when I call the super constructor in my extended class's constructor, it shows the error. – kp91 Mar 15 '17 at 07:17

2 Answers2

19

There are two separate versions of ResultReceiver. The support one defined in android.support.v4.os package has this issue.

For a quick fix, use the standard ResultReceiver defined in android.os package.

Sahil Patel
  • 684
  • 7
  • 19
1

I had the similar issue. You just need to update buildToolsVersion to '25.0.2' in build.gradle. After I updated error went away. clean n build.

Sanidhya Kumar
  • 714
  • 1
  • 6
  • 18