Search code examples
androidreact-nativeshoutem

error occurred configuring project react-native-photo-view


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

Solution

  • 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.