Closed morgane closed 6 years ago
That must mean the token isn’t in the right place or the script isn’t working correctly. Can you confirm that you have the token at either ~/.mapbox or ~/mapbox?
I added it to Info.plist per step #5 here. When I have it there, the app works (ie doesn't complain about lack of a token; maps load just fine) but still opens https://www.mapbox.com/account/access-tokens/.
When I tried the mapbox
text file instead, it throws an error in MapboxImageAPI.swift
:
"
accessToken
must be set in the Info.plist asMGLMapboxAccessToken
or theRoute
passed into theRouteController
must have theaccessToken
property set."
For further clarification, this only happens when I go through the "clone the repo" workflow. If I use Carthage instead, I don't have this problem.
The Xcode project is following this guide almost exactly. (We just updated the URL that the script opens, but that’s of little consequence here.)
I’m unable to reproduce this issue. The logic in the script is quite simple: if the file at ~/.mapbox or ~/mapbox contains any content at all, it sets the application’s access token to the contents of that file. Otherwise, it opens the access token page.
This same issue has been reported in mapbox/navigation-ios-examples#23, another repository that uses this script. I’m befuddled.
This issue reproduces only after incremental builds in Xcode 12 and above. This guide has been updated to note that $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
needs to be added to the Run Script build phase’s Input Files list.
Actually, that happened in #18.
Every time I build and run the project, it'll open https://www.mapbox.com/account/access-tokens/, even though I've already added my token. It's a minor annoyance and doesn't break anything, but also doesn't need to keep happening.