E/Sync: PusherInternal{http://my_ip_address/db/, push, 1bc10}: Exception in start()
android.content.ReceiverCallNotAllowedException: BroadcastReceiver components are not allowed to register to receive intents
at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:152)
at android.app.ReceiverRestrictedContext.registerReceiver(ContextImpl.java:141)
at com.couchbase.lite.android.AndroidNetworkReachabilityManager.startListening(AndroidNetworkReachabilityManager.java:43)
at com.couchbase.lite.NetworkReachabilityManager.addNetworkReachabilityListener(NetworkReachabilityManager.java:37)
at com.couchbase.lite.replicator.ReplicationInternal.startNetworkReachabilityManager(ReplicationInternal.java:363)
at com.couchbase.lite.replicator.ReplicationInternal.start(ReplicationInternal.java:286)
at com.couchbase.lite.replicator.PusherInternal.start(PusherInternal.java:121)
at com.couchbase.lite.replicator.ReplicationInternal$14.doIt(ReplicationInternal.java:1362)
at com.couchbase.lite.replicator.ReplicationInternal$14.doIt(ReplicationInternal.java:1356)
at com.github.oxo42.stateless4j.StateConfiguration$3.doIt(StateConfiguration.java:135)
at com.github.oxo42.stateless4j.StateConfiguration$3.doIt(StateConfiguration.java:133)
at com.github.oxo42.stateless4j.StateRepresentation.executeEntryActions(StateRepresentation.java:118)
at com.github.oxo42.stateless4j.StateRepresentation.enter(StateRepresentation.java:97)
at com.github.oxo42.stateless4j.StateMachine.publicFire(StateMachine.java:199)
at com.github.oxo42.stateless4j.StateMachine.fire(StateMachine.java:126)
at com.couchbase.lite.replicator.ReplicationInternal$1.run(ReplicationInternal.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Which version of CBL are you using ? (Tagging @hideki )
1.3.1 , When i using pull start from a Thread, then it got this error. But sync with server well .
can i make multiple time push/pull start request ?
Hi @jislam150,
From the Android doc, the Context is no longer active when registerReceiver(...)
is called.
The following StackOverflow article suggests using Application context by Context.getApplicationContext()
.
So please try to pass ApplicationContext
to AndroidContext constructor when you instantiate AndroidContext?
Hote this solves your problem.
Thanks!
After addded channel , document shows this way . But when i call pull with channel name, didn’t get . Can you please tell what is wrong here . My sync function is :
function(doc,oldDoc) {
if (doc.type == “event”) {
channel(doc.city_channel); //where city_channel = [“Dhaka”];
}
}
Result after create Document . why “Dhaka”: null into channels?
“channels”: [
[
“Dhaka”
],
[
“Dhaka”
],
[
“Dhaka”
],
[
“Dhaka”
]
]
},
“channels”: {
“Dhaka”: null
},
Some troubleshooting tips -
- Can you reconfirm that your document has “type” property with value “event”?
- Does the user have permissions to the channel? https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/channels/index.html#programmatic-authorization.