[英]error occurred configuring project react-native-photo-view
I have just started with ReactNative and created a project using this tutorial . 我刚刚开始使用ReactNative并使用本教程创建了一个项目。 The project got built and a android application got installed on my phone.
该项目已建成,并且在我的手机上安装了android应用程序。
Then I used @shoutem/ui
library for UI components. 然后,我将
@shoutem/ui
库用于UI组件。 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
然后我取消链接
@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. 我没有使用Android Studio,所以我下载了
build-tools 25.0.0
并放在sdk / build-tools文件夹中。 But now I am facing 但是现在我面对
> A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23
This seems to be an issue with the available SDK Tools in your installation of Android Studio: 这似乎与您安装Android Studio时可用的SDK工具有关:
> 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. 要安装此程序,请启动Android Studio,转到“ SDK管理器”,然后选择“ SDK工具”选项卡,选中右下角的“
Show Package Details
选项,然后检查25.0.0 SDK工具,然后单击“应用”以下载并安装它们。
Here's a screenshot of the SDK Tools I use for my local environment for reference: 这是我用于本地环境以供参考的SDK工具的屏幕截图:
Furthermore, I'd just like to elaborate on the react-native (un)link
command. 此外,我只想详细说明
react-native (un)link
命令。 This is used to link native dependencies into your React Native project. 这用于将本地依赖项链接到您的React Native项目中。 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.
取消链接与卸载不一样,取消链接后,您仍然应该能够使用Shoutem UI Toolkit的所有非本机组件。
I am not using Android Studio, So I downloaded the build-tools 25.0.0 and placed in SDK/build-tools folder. 我没有使用Android Studio,因此我下载了构建工具25.0.0并放在SDK / build-tools文件夹中。 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. 当您运行
react-native run-android
它将自动下载所有依赖项以创建构建。
So In my case, I changed my network settings and this worked. 因此,以我为例,我更改了网络设置,并且此方法可行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.