question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to start the android hello world app on mac

See original GitHub issue

Description

Hello, I’m new to react native and have problems to setup the hello world app. I followed the instruction on the „Getting Started“ page for installing android on mac.

First problems occur at „Starting the Android Virtual Device“ step. $ android outputs

The android command is no longer available. For manual SDK and AVD management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager

Then I created a new empty project in Android Studio and startet the AVD using the menu > tools > android > AVD Manager. This window looks different to the one in the docs (see picture). There is no option named „Using Host GPU“. Only thing I’ve discovered was the Option „Graphcs“. I turned that from „automatic“ to „Hardware GLES 2.0“.

avd

Then I started the emulator using the play button and run $ react-native run-android. Now I get the error:

… Skipping device ‘emulator-5554’ (emulator-5554): Device is UNAUTHORIZED, see http://d.android.com/tools/help/adb.html#Enabling. :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong: Execution failed for task ‘:app:installDebug’. > com.android.builder.testing.api.DeviceException: No online devices found.

Hmf, no idea what the error means. Maybe its working with android studio. Then I opened the folder AwesomeProject/android using File > Open… in Android Studio and hit the make Project button. Now I see the Error in the Console:

Error:The SDK Build Tools revision (23.0.1) is too low for project ‘:app’. Minimum required is 25.0.0

Then I plugged in my samsung s6 with usb debugging on and run $ react-native run-android again. Now it appears:

NDK is missing a “platforms” directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/benny/Library/Android/sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

FAILURE: Build failed with an exception.

* What went wrong: A problem occurred configuring project ‘:app’. > The SDK Build Tools revision (23.0.1) is too low for project ‘:app’. Minimum required is 25.0.0

So what am I doing wrong? please help, thanks.

Reproduction

see steps above.

Solution

Please help me to find one.

Additional Information

  • React Native version: 0.42.3
  • Platform: Android
  • Development Operating System: MacOS
  • Dev tools: Android Studio 2.3 (build Feb 24 2017)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mtimofiivcommented, Nov 11, 2017

For anyone else having this problem, simply do this in your build.gradle:

buildToolsVersion "25.0.0"

Seems to work for me!

1reaction
axtencommented, Mar 22, 2017

Ok I fixed the last error by deleting the virtual device and creating a new one. Now I choose nexus 6 and now it works. Note that it can take up to a minute until the emulator is launched properly.

Summary for later visitors

  • make sure that the port 8081 is free using sudo lsof -i :8081 and sudo kill -9 <pid>
  • try creating multiple Virtual Devices until android boots properly in the emulator
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio emulator will not run a simple Hello World ...
I am unable to run a simple hello world app in Android Studio(2.1.2). It will load the emulator, and I will just get...
Read more >
How to Install Android Studio on Mac - YouTube
Launch the Android Studio dmg file. We will also see how to create our first " Hello World " android app in android...
Read more >
How to Install Android Studio on Mac + Build Your First App in ...
How to install Java JDK on Mac OS X ( with JAVA_HOME ) ... We will also see how to create our first...
Read more >
How to build the Hello World App in Android Studio - YouTube
Watch and learn how to get started using Android Studio by building the Hello World application. Hello World is the first app you...
Read more >
How to develop Hello World App in Android Studio 2021
Your browser can't play this video. ... How to develop Hello World App in Android Studio 2021 | Develop First Android App for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found