Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Rename access_token resource #3119

Closed
tobrun opened this issue Nov 25, 2015 · 6 comments · Fixed by #3984
Closed

Rename access_token resource #3119

tobrun opened this issue Nov 25, 2015 · 6 comments · Fixed by #3984
Assignees
Labels
Android Mapbox Maps SDK for Android bug

Comments

@tobrun
Copy link
Member

tobrun commented Nov 25, 2015

Been thinking a bit about this and it might be a good idea to rename access_token resource:

<resources>
    <string name="access_token">null</string>
</resources>

to

<resources>
    <string name="mapbox_access_token">null</string>
</resources>

Their is always the possibility that the end user or another library, that the end user is using, is overriding the resource by using resource merging. By prepending mapbox to the key we are making a more unique identifier.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Nov 25, 2015
@tobrun tobrun added this to the android-v2.3.0 milestone Nov 25, 2015
@mb12
Copy link

mb12 commented Nov 25, 2015

Or we can just add namespace map box to all sdk strings.

<resources>
    <mapbox name="access_token">null</mapbox>
</resources>

@tobrun
Copy link
Member Author

tobrun commented Dec 1, 2015

namespace strings are now a supported feature in build.gradle

screen shot 2015-12-01 at 20 42 42

@bleege bleege modified the milestones: android-v2.3.0, android-v2.4.0 Dec 4, 2015
@bleege bleege modified the milestones: android-v3.0.0, android-v3.1.0 Dec 21, 2015
@bleege bleege modified the milestones: android-v3.1.0, android-v4.0.0 Jan 20, 2016
@tobrun
Copy link
Member Author

tobrun commented Feb 17, 2016

screen shot 2016-02-17 at 09 09 08

@bleege
Copy link
Contributor

bleege commented Feb 18, 2016

This is causing an error when at build time, meaning that it's not possible to build from master right now.

/Users/brad/development/mapbox-gl-android/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml:11:30-57 : AAPT: No resource found that matches the given name (at 'access_token' with value '@string/mapbox_access_token').

/Users/brad/development/mapbox-gl-android/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml:25:34-61 : AAPT: No resource found that matches the given name (at 'access_token' with value '@string/mapbox_access_token').

:MapboxGLAndroidSDKTestApp:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':MapboxGLAndroidSDKTestApp:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/android/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

@bleege bleege reopened this Feb 18, 2016
@bleege bleege added the bug label Feb 18, 2016
@bleege
Copy link
Contributor

bleege commented Feb 18, 2016

The error turned out to be that when running it locally the key in developer-config.xml needed to be renamed from access_token to mapbox_access_token. I've updated the install docs to better communicate this.

@bleege bleege closed this as completed Feb 18, 2016
@tobrun
Copy link
Member Author

tobrun commented Feb 19, 2016

@bleege, I didn't came to mind that others had to remove/regenerate the file (because it's gitignored..). Apologies!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants