0

I followed the instruction to install native-base from nativebase.io and to setup the project. I was successful at that, after running the command react-native run-android I get a successful message in the CMD telling

BUILD SUCCESSFUL

Total time: 15.051 secs
'adb' is not recognized as an internal or external command,
operable program or batch file.
Starting the app (C:\Users\DELL\AppData\Local\Android\sdk/platform-tools/adb 
shell am start -n 
com.awesomenativebase/com.awesomenativebase.MainActivity...
Starting: Intent { cmp=com.awesomenativebase/.MainActivity }

but, I get the following error in my App that is running in my physical device(Samsung kitkat 4.4.4): enter image description here

My code in App.js:

import React, { Component } from 'react';
import { Container, Header, Title, Content, Footer, FooterTab, Button, Left, 
Right, Body, Icon, Text } from 'native-base';
export default class AnatomyExample extends Component {
   render() {
      return (
      <Container>
        <Header>
           <Left>
           <Button transparent>
           <Icon name='menu' />
           </Button>
           </Left>
        <Body>
           <Title>Header</Title>
        </Body>
           <Right />
        </Header>
          <Content>
          <Text>
          This is Content Section
          </Text>
          </Content>
          <Footer>
          <FooterTab>
          <Button full>
          <Text>Footer</Text>
          </Button>
          </FooterTab>
          </Footer>
      </Container>
);
}

Can anyone help on this? Thank you.

Jason
  • 122
  • 2
  • 11
  • Did you try adb reverse tcp:8081 tcp:8081 before running? – Levon Petrosyan Nov 06 '17 at 07:29
  • While doing adb reverse tcp:8081 tcp:8081 I get error:closed message. @LevonPetrosyan – Jason Nov 06 '17 at 07:36
  • https://stackoverflow.com/questions/44446523/unable-to-load-script-from-assets-index-android-bundle-on-windows did you check this answer? – Levon Petrosyan Nov 06 '17 at 07:37
  • 1
    1) Open the in-app Developer menu. 2) Go to Dev Settings → Debug server host for device. 3) Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). 4) Go back to the Developer menu and select Reload JS. – Kapil Yadav Nov 06 '17 at 07:38
  • 1
    @KapilYadav Fantastic. Thank you. At least for me it's running now. – Stefan Wanitzek Feb 04 '18 at 13:21

1 Answers1

0

First make sure that the both devices (physical device & the device on which the code is running) on the same network.

Shake the physical device, it opens the debugger options.

Go to Dev Settings -> Debug server host & port for device.

It should be empty if you're device is connected by usb otherwise enter the ip address of your laptop followed by the port on which the packager is running. For e.g 12:34:56:78:8081

Kuldeep Saxena
  • 1,803
  • 1
  • 14
  • 17