0

I have just started with ReactNative and created a project using this tutorial. The project got built and a android application got installed on my phone.

Then I used @shoutem/ui library for UI components. According to the documentation, I tried

npm install @shoutem/ui --save
react-native link

and then run the project using

react-native run-android

But then I got this error

PS D:\SK\Study\ReactNative\DemoRN> react-native run-android
Scanning folders for symlinks in D:\SK\Study\ReactNative\DemoRN\node_modules (38ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
File C:\Users\sukumar\.android\repositories.cfg could not be loaded.
Failed to download any source lists!
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-photo-view'.
      > Failed to find Build Tools revision 25.0.0

* 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: 11.028 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

And then I unlinked the @shoutem/ui

react-native unlink @shoutem/ui

and tried to run the project, but still, I am facing the same issue?

Please ignore if it is too basic to ask, But I am not able to understand what is the issue?

Update

I am not using Android Studio, So I downloaded the build-tools 25.0.0 and placed in sdk/build-tools folder. But now I am facing

> A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23
Sunil Garg
  • 14,608
  • 25
  • 132
  • 189

2 Answers2

2

This seems to be an issue with the available SDK Tools in your installation of Android Studio:

      > Failed to find Build Tools revision 25.0.0

Installing these should resolve the issue. To install this, start up Android studio, go to the SDK Manager and select the SDK Tools tab, check the Show Package Details option in the bottom right corner and then check the 25.0.0 SDK Tools and click Apply to download and install them.

Here's a screenshot of the SDK Tools I use for my local environment for reference:

enter image description here

Furthermore, I'd just like to elaborate on the react-native (un)link command. This is used to link native dependencies into your React Native project. Unlinking it is not the same as uninstalling it, you should still be able to use all non-native components of the Shoutem UI Toolkit after unlinking the package.

  • I am not using Android Studio, So i downloaded the `build-tools 25.0.0` and placed in sdk/build-tools folder. But now I am facing `> A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23` – Sunil Garg Jan 12 '18 at 09:25
1

I am not using Android Studio, So I downloaded the build-tools 25.0.0 and placed in SDK/build-tools folder. This solved the build tools issue but then there was a new issue

A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23 

The network I was using has configured some firewalls rules that were not allowing the required dependencies get downloaded. When you run react-native run-android it downloads all the dependencies automatically to create the build.

So In my case, I changed my network settings and this worked.

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189