{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5541","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5541/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5541/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5541/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5541","id":163513900,"number":5541,"title":"MapboxAccountManager not correctly initialised ","user":{"login":"tobrun","id":2151639,"avatar_url":"https://avatars.githubusercontent.com/u/2151639?v=3","gravatar_id":"","url":"https://api.github.com/users/tobrun","html_url":"https://github.com/tobrun","followers_url":"https://api.github.com/users/tobrun/followers","following_url":"https://api.github.com/users/tobrun/following{/other_user}","gists_url":"https://api.github.com/users/tobrun/gists{/gist_id}","starred_url":"https://api.github.com/users/tobrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobrun/subscriptions","organizations_url":"https://api.github.com/users/tobrun/orgs","repos_url":"https://api.github.com/users/tobrun/repos","events_url":"https://api.github.com/users/tobrun/events{/privacy}","received_events_url":"https://api.github.com/users/tobrun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/Android","name":"Android","color":"5319e7"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/support","name":"support","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false},"assignees":[{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-07-02T11:11:40Z","updated_at":"2016-07-11T20:30:52Z","closed_at":null,"body":"Capturing from @geohacker that some people were having trouble setting up a working Mapview using the MapboxAccountManager setup. They were running into an invalid access token exception. This is the code they were using:\r\n\r\n```java\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n        MapboxAccountManager.start(MainActivity.this, \"somekey\");\r\n        mapView  = (MapView) findViewById(R.id.mapview);\r\n        mapView.onCreate(savedInstanceState);\r\n    }\r\n```\r\n\r\nI asked if they could move the initialisation code to the Application object but that didn't resolve the issue. We need to look into reproducing this by setting up a new android project from scratch using `4.1.0` dependency."},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/231855082","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/5541#issuecomment-231855082","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5541","id":231855082,"user":{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T20:30:52Z","updated_at":"2016-07-11T20:30:52Z","body":">  That said, this isn't a requirement and is removable. \r\n\r\n@tobrun Can you speak more to this?\r\n\r\n> I'm also thinking about improving our user facing messages around this. This can either be done through by showing a concrete exception or improving our messages for InvalidAccessTokenException.\r\n\r\nTotally!  👍   @cammace updated https://www.mapbox.com/android-sdk/examples/ last week to get us started on this.  I like the `MapboxAcountManagerNotStartedException` idea that you started quite a bit.  I wonder if now is the right time for this though as `MapboxAccountManager` won't officially become the one and only way for access tokens until the deprecated Access Token methods are fully removed in #5621.  #5621 is a SemVer bump which means it'll happen in `5.0.0` at the soonest.\r\n"}}
{"actor":{"display_login":"bleege"}}