0

enter image description here

This is my index.android.js file

import React, { Component } from 'react';
import {
  AppRegistry,
  Navigator,
} from 'react-native';

import SplashPage from './SplashPage';
import MainPage from './MainPage';
import Pager from './Pager';
import App from './App';

class Demo extends Component {
  render() {
    return (
      <Navigator
          initialRoute={{id: 'SplashPage', name: 'Index'}}
          renderScene={this.renderScene.bind(this)}
          configureScene={(route) => {
              if (route.sceneConfig) {
                return route.sceneConfig;
              }
              return Navigator.SceneConfigs.FloatFromRight;
          }} />
    );
  }
  renderScene(route, navigator) {
    const routeId = route.id;
    if (routeId === 'SplashPage') {
      return (
        <SplashPage
          navigator={navigator} />
      );
    }
    if (routeId === 'App') {
      return (
        <App
          navigator={navigator} />
      );
    }
  }
}
AppRegistry.registerComponent('Demo', () => Demo);

This is my AndroidManifest.xml

<activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

      <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="MY_API_KEY"/>

I have referred to the following url https://github.com/lelandrichardson/react-native-maps.I have also resolved the API's issue but still map not getting rendered. Please help and thanks in advance.

CaseyB
  • 24,780
  • 14
  • 77
  • 112
atif
  • 759
  • 4
  • 13
  • 25
  • It should tell you in the LogCat what's going wrong. What does it say there? – CaseyB Jun 29 '16 at 12:38
  • where i can see logcat while running react-native apps? i used the command adb logcat *:S ReactNative:V ReactNativeJS:V to see the logcat but it shows nothing. – atif Jun 29 '16 at 13:03
  • I'v never used React Native so hopefully someone else can help with that bit. – CaseyB Jun 29 '16 at 13:08
  • Have you tried to add Google Play Services to your Genymotion? here's a SO ticket show how to [install Google Play Services in a Genymotion](http://stackoverflow.com/questions/20121883/how-to-install-google-play-services-in-a-genymotion-vm-with-no-drag-and-drop-su) – Android Enthusiast Jun 30 '16 at 17:55

1 Answers1

0

Hey guys the above code is proper and there is no bug just the issue is that maps don't work on genymotion. To make app running on genymotion follow the link How to install Google Play Services in a Genymotion VM (with no drag and drop support)? proved to be very helpful. The following code https://github.com/lelandrichardson/react-native-maps. runs fine on physical device. Hope this will be helpful.

Community
  • 1
  • 1
atif
  • 759
  • 4
  • 13
  • 25