Skip to content

React native is not starting on android emulator #28812

Closed
@dansmog

Description

@dansmog

NB: This isn't a bug with react-native, I just need help with this.

Description
So I messed up with my environment variables settings, after moving for bash to zsh. But now I have sorted it out, when I run a flutter project from android studio, it shows on an emulator.
but when I run react-native run-android, I get the below error

error Failed to install the app. Make sure you have the Android development environment set up

Although the project works fine on Ios.

This is currently how my .zshrc is configured

...
...
export ANDROID_HOME=/Users/squarelabs/Library/Android/sdk
export PATH=$ANDROID_HOME/emulators:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH

and I also have this in my local.properties sdk.dir=/Users/squarelabs/Library/Android/sdk

React Native version:

    OS: macOS 10.15
    CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
    Memory: 131.53 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.8.0 - /usr/local/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.9.1 - /usr/local/lib/ruby/gems/2.7.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      Android NDK: 18.1.5063045
  IDEs:
    Android Studio: 3.3 AI-182.5107.16.33.5199772
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  Languages:
    Java: 14.0.1 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions