Closed LuannguyenAxonActive closed 1 year ago
Please fix the errors in your code example - More info.:
error: 'SecuredConfig' is not defined (no-undef) at example.jsx:5:23:
3 | import Mapbox from '@rnmapbox/maps';
4 |
> 5 | Mapbox.setAccessToken(SecuredConfig.MAPBOX_ACCESS_TOKEN);
| ^
6 |
7 | <Mapbox.MapView
8 | ref={ref}
error: 'ref' is not defined (no-undef) at example.jsx:8:14:
6 |
7 | <Mapbox.MapView
> 8 | ref={ref}
| ^
9 | style={[styles.map, isMapLoaded && styles.active]}
10 | onDidFinishLoadingMap={() => {
11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
error: 'styles' is not defined (no-undef) at example.jsx:9:17:
7 | <Mapbox.MapView
8 | ref={ref}
> 9 | style={[styles.map, isMapLoaded && styles.active]}
| ^
10 | onDidFinishLoadingMap={() => {
11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
12 | setIsMapLoaded(true);
error: 'isMapLoaded' is not defined (no-undef) at example.jsx:9:29:
7 | <Mapbox.MapView
8 | ref={ref}
> 9 | style={[styles.map, isMapLoaded && styles.active]}
| ^
10 | onDidFinishLoadingMap={() => {
11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
12 | setIsMapLoaded(true);
error: 'styles' is not defined (no-undef) at example.jsx:9:44:
7 | <Mapbox.MapView
8 | ref={ref}
> 9 | style={[styles.map, isMapLoaded && styles.active]}
| ^
10 | onDidFinishLoadingMap={() => {
11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
12 | setIsMapLoaded(true);
error: 'onDidFinishLoadingMap' is not defined (no-undef) at example.jsx:11:11:
9 | style={[styles.map, isMapLoaded && styles.active]}
10 | onDidFinishLoadingMap={() => {
> 11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
| ^
12 | setIsMapLoaded(true);
13 | }}
14 | styleURL={MAP_LIGHT_THEME_STYLE}
error: 'onDidFinishLoadingMap' is not defined (no-undef) at example.jsx:11:36:
9 | style={[styles.map, isMapLoaded && styles.active]}
10 | onDidFinishLoadingMap={() => {
> 11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
| ^
12 | setIsMapLoaded(true);
13 | }}
14 | styleURL={MAP_LIGHT_THEME_STYLE}
error: 'setIsMapLoaded' is not defined (no-undef) at example.jsx:12:11:
10 | onDidFinishLoadingMap={() => {
11 | onDidFinishLoadingMap && onDidFinishLoadingMap();
> 12 | setIsMapLoaded(true);
| ^
13 | }}
14 | styleURL={MAP_LIGHT_THEME_STYLE}
15 | onRegionIsChanging={onRegionIsChanging}
error: 'MAP_LIGHT_THEME_STYLE' is not defined (no-undef) at example.jsx:14:19:
12 | setIsMapLoaded(true);
13 | }}
> 14 | styleURL={MAP_LIGHT_THEME_STYLE}
| ^
15 | onRegionIsChanging={onRegionIsChanging}
16 | onMapIdle={handleOnMapIdle}
17 | onTouchStart={onTouchStart}
error: 'onRegionIsChanging' is not defined (no-undef) at example.jsx:15:29:
13 | }}
14 | styleURL={MAP_LIGHT_THEME_STYLE}
> 15 | onRegionIsChanging={onRegionIsChanging}
| ^
16 | onMapIdle={handleOnMapIdle}
17 | onTouchStart={onTouchStart}
18 | logoEnabled={false}
error: 'handleOnMapIdle' is not defined (no-undef) at example.jsx:16:20:
14 | styleURL={MAP_LIGHT_THEME_STYLE}
15 | onRegionIsChanging={onRegionIsChanging}
> 16 | onMapIdle={handleOnMapIdle}
| ^
17 | onTouchStart={onTouchStart}
18 | logoEnabled={false}
19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
error: 'onTouchStart' is not defined (no-undef) at example.jsx:17:23:
15 | onRegionIsChanging={onRegionIsChanging}
16 | onMapIdle={handleOnMapIdle}
> 17 | onTouchStart={onTouchStart}
| ^
18 | logoEnabled={false}
19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
20 | scaleBarEnabled={IS_ANDROID}
error: 'IS_ANDROID' is not defined (no-undef) at example.jsx:19:27:
17 | onTouchStart={onTouchStart}
18 | logoEnabled={false}
> 19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
| ^
20 | scaleBarEnabled={IS_ANDROID}
21 | attributionEnabled={displayAttributionButton}
22 | attributionPosition={ATTRIBUTION_BUTTON_POSITION}
error: 'ANDROID_SCALE_BAR_POSITION' is not defined (no-undef) at example.jsx:19:40:
17 | onTouchStart={onTouchStart}
18 | logoEnabled={false}
> 19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
| ^
20 | scaleBarEnabled={IS_ANDROID}
21 | attributionEnabled={displayAttributionButton}
22 | attributionPosition={ATTRIBUTION_BUTTON_POSITION}
error: 'IS_ANDROID' is not defined (no-undef) at example.jsx:20:26:
18 | logoEnabled={false}
19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
> 20 | scaleBarEnabled={IS_ANDROID}
| ^
21 | attributionEnabled={displayAttributionButton}
22 | attributionPosition={ATTRIBUTION_BUTTON_POSITION}
23 | compassEnabled={false}
error: 'displayAttributionButton' is not defined (no-undef) at example.jsx:21:29:
19 | scaleBarPosition={IS_ANDROID ? ANDROID_SCALE_BAR_POSITION : undefined}
20 | scaleBarEnabled={IS_ANDROID}
> 21 | attributionEnabled={displayAttributionButton}
| ^
22 | attributionPosition={ATTRIBUTION_BUTTON_POSITION}
23 | compassEnabled={false}
24 | rotateEnabled={false}
error: 'ATTRIBUTION_BUTTON_POSITION' is not defined (no-undef) at example.jsx:22:30:
20 | scaleBarEnabled={IS_ANDROID}
21 | attributionEnabled={displayAttributionButton}
> 22 | attributionPosition={ATTRIBUTION_BUTTON_POSITION}
| ^
23 | compassEnabled={false}
24 | rotateEnabled={false}
25 | regionDidChangeDebounceTime={100}
error: 'props' is not defined (no-undef) at example.jsx:27:12:
25 | regionDidChangeDebounceTime={100}
26 | pitchEnabled={false}>
> 27 | {props.children}
| ^
28 | </Mapbox.MapView>
29 |
18 errors found.```
Mapbox Implementation
Mapbox
Mapbox Version
10.13.1
Platform
Android
@rnmapbox/maps
version10.0.8
Standalone component to reproduce
Observed behavior and steps to reproduce
Caused by com.mapbox.maps.MapboxConfigurationException Using MapView requires providing a valid access token when inflating or creating the view. Provide the token by either: 1. Initialising the MapView programmatically using 'MapInitOptions' and configure the token using 'MapInitOptions.resourceOptions.accessToken'. 2. Or by passing it using MapView's 'mapbox_resourcesAccessToken' XML attribute. 3. Or by creating a mapbox_access_token string resource. The access token parameter is required when using a Mapbox service. Please see https://www.mapbox.com/help/create-api-access-token/ to learn how to create one. More information in this guide https://www.mapbox.com/help/first-steps-android-sdk/#access-tokens.
Expected behavior
No response
Notes / preliminary analysis
It was just reported on our Firebase crash analytics, Seems just happens abnormally on some Samsung devices (Galaxy A53 5G, Galaxy S10e, Galaxy A13 5G), other devices still work with the same implementation. I'm not sure about the chip of these devices.
Additional links and references
No response