Help with React Activate

Asked

Viewed 761 times

2

Guys I have an annoying error when installing React:

~/MyApp $ react-native run-android
Scanning 555 folders for symlinks in /home/henrique/MyApp/node_modules (4ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
File /home/henrique/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 23.0.1 in /home/henrique/Sdk/licenses
License for package Android SDK Build-Tools 23.0.1 accepted.
Preparing "Install Android SDK Build-Tools 23.0.1".
Warning: Failed to read or create install properties file.
Checking the license for package Android SDK Platform 23 in /home/henrique/Sdk/licenses
License for package Android SDK Platform 23 accepted.
Preparing "Install Android SDK Platform 23".
Warning: Failed to read or create install properties file.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following SDK components:
  [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]
  Please install the missing components using the SDK manager in Android Studio.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.957 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

I tried to install Android SDK Platform 23, but still nothing... Has anyone been there? Thanks in advance.

  • Guys I restarted, now ta with this error: SDK Location not found. Define Location with sdk.dir in the local.properties file or with an ANDROID_HOME Environment variable.

1 answer

6


Create a file called local.properties and go to the folder android of its Reactnative.

The file extension must be .properties. Put the following configuration inside the archive:

sdk.dir=C\:\\Users\\MyName\\AppData\\Local\\Android\\Sdk

Usually the Sdk is installed on this path, make sure it is correct before doing so.

If you are using the Windows, utilize \\ to enter the path.

If you are using the Android Studio or have already used it, you can go in the folder of a project created, copy the local.properties and paste into the folder Android of its Reactnative.


If you come across the error below

You have not accepted the License Agreements of the following SDK Components: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]

You can do the following: go to the directory of Sdk, the same that was defined in local properties. and open the folder tools\bin, copy the directory path, open the CMD and do the following:

cd C:\Users\MyName\AppData\Local\Android\Sdk\tools\bin

C:\Users\MyName\AppData\Local\Android\Sdk\tools\bin>sdkmanager --licenses

Something like this is gonna come along:

x of y SDK package licenses not accepted Review licenses that have not been accepted? (y/n)

Typo Y and tighten enter. Continue typing Y and squeezing enter to accept the permits.

  • Thank you Luc. But now it has given the initial error again: Failed to install the following SDK Components: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1] Please install the Missing Components using the SDK manager in Android Studio.

  • It is because the path of the Sdk you have placed does not have these build tools.

  • 1

    Try to see which directory you downloaded and installed the Apis, take the path and put in the local.properties.

  • Thank you very much Luc! It seems that now it’s almost there, it’s still giving inconsistency errors of some files > You have not accepted the License Agreements of the following SDK Components: [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]. Before building your project, you need to Accept the License Agreements and complete the installation of th e Missing Components using the Android Studio SDK Manager. Alternatively, to Learn how to transfer the License Agreements from one Workstation to Another, go to http: //d.android.com/r/studio-ui/export-licenses.html

  • Edited response!

  • Gee, value Luc, it worked. I mean you still have a few problems. But the worst is over hehe . I have already managed to resolve the issue of licenses, I mean solved several errors that were occurring thanks to you, thank you very much. I’m already able to open the app screen in cel, although it’s red giving some errors, but I think it should be simpler than the others. Once again thank you so much for your help! All good partner.

  • For nothing!... :)

  • @Henriquenascimento if the answer solved your problem please mark it as correct.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.