我刚刚开始使用 ReactNative 并使用本教程创建了一个项目。该项目已建成,并在我的手机上安装了一个 android 应用程序。
然后我使用@shoutem/ui
了 UI 组件库。根据文档,我尝试了
npm install @shoutem/ui --save
react-native link
然后使用运行项目
react-native run-android
但后来我得到了这个错误
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
然后我取消链接@shoutem/ui
react-native unlink @shoutem/ui
并尝试运行该项目,但我仍然面临同样的问题?
如果问得太基本,请忽略,但我无法理解问题是什么?
更新
我没有使用 Android Studio,所以我下载build-tools 25.0.0
并放置在 sdk/build-tools 文件夹中。但现在我面临
> A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23