DevGe
DevGe

Reputation: 1449

How to solved UIManager['AIRMapLite'] is no longer supported. (White Screen with white Logo)

I'm not able to solve this problem for the last 2 days. I've done the search and read documents of mapview but still unable to solve it.

Error

I will show you my codes and the scenario that I do.

My Import

import MapView from 'react-native-maps';

My Function

    export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <MapView
          zoomEnabled = {true}
          style={ styles.map }
          initialRegion={{
            latitude: 37.78825,
            longitude: -122.4324,
            latitudeDelta: 0.0922,
            longitudeDelta: 0.0421,
          }}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  map: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    ...StyleSheet.absoluteFillObject,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

Lastly the activation key of google

<meta-data 
        android:name="com.google.android.geo.API_KEY"
        android:value="i make it secret first"
      />

Activate

this is the error in my console, I don't know the issue happen

    if (__DEV__) {
  Object.keys(UIManager).forEach(viewManagerName => {
    if (!UIManagerProperties.includes(viewManagerName)) {
      if (!viewManagerConfigs[viewManagerName]) {
        viewManagerConfigs[viewManagerName] = UIManager[viewManagerName];
      }
      defineLazyObjectProperty(UIManager, viewManagerName, {
        get: () => {
          console.warn(
            `Accessing view manager configs directly off UIManager via UIManager['${viewManagerName}'] ` +
              `is no longer supported. Use UIManager.getViewManagerConfig('${viewManagerName}') instead.`,
          );
          return UIManager.getViewManagerConfig(viewManagerName);
        },
      });
    }
  });
}

Upvotes: 1

Views: 1209

Answers (1)

Andrew
Andrew

Reputation: 28539

This is currently a known issue in react-native-maps. An issue was initially created in December 2018.

It is actually an issue with how the dependency has been implemented. So there isn't really anything that you can do about it other than forking the repo, and fixing the underlying issue yourself.

As of the 11 March 2019, it has now been fixed and should no longer be an issue. The fix has been included in the next release. So once the next release of react-native-maps is out you should no longer experience the warning.

https://github.com/react-native-community/react-native-maps/issues/2620#issuecomment-471650689

fixed on master, should be included in the next release

If you cannot wait for the issue to be fixed and you want to hide the YellowBox warning you can do it by using the following

import {YellowBox} from 'react-native';

Then inside your render method, I usually do it in the App.js so it is easy to keep track of which ones I have hidden.

render() {
  YellowBox.ignoreWarnings(['Warning: ...']);  // <- insert the warning text here you wish to hide. 
  return (
    //cool ui stuff
  );
}

It won't remove the warning from your console, but it will remove any YellowBox warnings associated with the error.

Upvotes: 1

Related Questions