[GH-ISSUE #163] readLogs Producer is registered mutlitple times in two different classes #125

Closed
opened 2026-02-28 01:23:18 +03:00 by kerem · 8 comments
Owner

Originally created by @Briar503 on GitHub (May 7, 2014).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/163

Getting the following exception when running intermittently:

java.lang.IllegalArgumentException: Producer method for type boolean found on type class org.addhen.smssync.services.AutoSyncScheduledService, but already registered by type class org.addhen.smssync.services.SmsReceiverService.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2275)
at android.app.ActivityThread.access$1600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4512)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)

This exception is causing the App to crash

Originally created by @Briar503 on GitHub (May 7, 2014). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/163 Getting the following exception when running intermittently: java.lang.IllegalArgumentException: Producer method for type boolean found on type class org.addhen.smssync.services.AutoSyncScheduledService, but already registered by type class org.addhen.smssync.services.SmsReceiverService. at android.app.ActivityThread.handleCreateService(ActivityThread.java:2275) at android.app.ActivityThread.access$1600(ActivityThread.java:127) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4512) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561) at dalvik.system.NativeStart.main(Native Method) This exception is causing the App to crash
kerem 2026-02-28 01:23:18 +03:00
Author
Owner

@eyedol commented on GitHub (May 8, 2014):

Yes, that will potentially cause the app to crash.

<!-- gh-comment-id:42501671 --> @eyedol commented on GitHub (May 8, 2014): Yes, that will potentially cause the app to crash.
Author
Owner

@z-br commented on GitHub (May 8, 2014):

Any suggestions on how to fix? This is very reproducible. We just had to put exception traps around the register calls.

<!-- gh-comment-id:42501990 --> @z-br commented on GitHub (May 8, 2014): Any suggestions on how to fix? This is very reproducible. We just had to put exception traps around the register calls.
Author
Owner

@eyedol commented on GitHub (May 8, 2014):

@gregpassmore this is actually supposed to be readLog() not readLogs() so rename it to readLog() in AutoSyncScheduledService. I'll refactor this later on.

<!-- gh-comment-id:42503863 --> @eyedol commented on GitHub (May 8, 2014): @gregpassmore this is actually supposed to be `readLog()` not `readLogs()` so rename it to `readLog()` in [AutoSyncScheduledService](https://github.com/ushahidi/SMSSync/blob/develop/smssync/src/main/java/org/addhen/smssync/services/AutoSyncScheduledService.java#L66). I'll refactor this later on.
Author
Owner

@KamilKalfas commented on GitHub (May 22, 2014):

Is someone working on this ?

<!-- gh-comment-id:43887802 --> @KamilKalfas commented on GitHub (May 22, 2014): Is someone working on this ?
Author
Owner

@eyedol commented on GitHub (May 23, 2014):

@KamilKalfas I don't think so. You can take it.

<!-- gh-comment-id:43969471 --> @eyedol commented on GitHub (May 23, 2014): @KamilKalfas I don't think so. You can take it.
Author
Owner

@KamilKalfas commented on GitHub (May 29, 2014):

@ubiquill, @gregpassmore could you write me a repro steps ?
@eyedol renaming this method in both services ('CheckTaskScheduledService', 'AutoSyncScheduledService') should be enough to fix this ?

<!-- gh-comment-id:44511287 --> @KamilKalfas commented on GitHub (May 29, 2014): @ubiquill, @gregpassmore could you write me a repro steps ? @eyedol renaming this method in both services ('CheckTaskScheduledService', 'AutoSyncScheduledService') should be enough to fix this ?
Author
Owner

@eyedol commented on GitHub (May 29, 2014):

@KamilKalfas yes it should.

<!-- gh-comment-id:44520305 --> @eyedol commented on GitHub (May 29, 2014): @KamilKalfas yes it should.
Author
Owner

@KamilKalfas commented on GitHub (May 29, 2014):

Fixed in PR #172

<!-- gh-comment-id:44523696 --> @KamilKalfas commented on GitHub (May 29, 2014): Fixed in PR #172
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#125
No description provided.