0

i have a very big problem. I'm building an app at the moment. When I start the App with the Android emulator it works fine. I can save some Data and it will show me these too. So it saves the Data locally. (Couchbase Lite) I work with an ionic framework. Now I want to sync between Couchbase Server and Couchbase Lite. I use the Sync Gateway, but it doesn't work. Below you can see my sync-gateway-config.json and my log. Can someone help me please?

{
   "interface": ":4984",
   "adminInterface": "0.0.0.0:4985",
   "log": ["*"],
   "databases":  {
      "syncdb":    {
         "server": "http://127.0.0.1:8091",
         "bucket": "sync_gateway",
         "username": "sync_gateway",
         "password": "********",
         "sync":
             function (doc)  {
                 channel (doc.channels);
             },
          "users": {
            "GUEST": {
                "disabled": true,
                "admin_channels": ["public"]
            },
            "Administrator": {
                "disabled": false,
                "password": "**********",
                "admin_channels": ["*"]
            }
       }
    }

Log

WINADA
  • 1
  • 1

2 Answers2

0

The Android emulator uses a special address to connect to the machine it runs on. Set your app to connect to Sync Gateway via 10.0.2.2. See this Stack Overflow post for more information.

Hod
  • 2,236
  • 1
  • 14
  • 22
  • I already set my app to connect to Sync Gateway via 10.0.2.2, but it shows the same log and doesn't work – WINADA Oct 28 '17 at 13:49
0

you can add the property: "import_docs": "continuous", and "enable_shared_bucket_access": true, in your database config, between syncdb braces, to see if there is a differencee. "syncdb": { "import_docs": "continuous", "enable_shared_bucket_access": true, "server": "http://127.0.0.1:8091", ........ }

Zahra
  • 29
  • 1
  • 7