This error message is pretty clear:
CookieSyncManager::createInstance() needs to be called before CookieSyncManager::getInstance()
But I only get this error because I followed the official documentation:
To use the CookieSyncManager, the host application has to call the following when the application starts:
CookieSyncManager.createInstance(context)
To set up for sync, the host application has to call
CookieSyncManager.getInstance().startSync()
in Activity.onResume()
The error occurs only when the application attempts to resume, not when it starts cleanly.
So, I can probably fix that by moving CookieSyncManager.createInstance(context)
to Activity.onResume()
but... won't that create a new problem?
(for example, forgetting the previous session cookies every time the app resumes?)