【问题标题】:I am trying to install react-native-image-picker but getting this error我正在尝试安装 react-native-image-picker 但收到此错误
【发布时间】:2020-07-18 03:14:52
【问题描述】:

我正在尝试安装图像选择器,它已安装。但随后运行 android 后会抛出此错误。当我从包 json 中删除已安装的图像选择器行时,问题得到解决。我该如何解决这个问题?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Unable to delete directory 'D:\React\OMW\project\omw_mobile2\onmyway_mobile\OnMyWay\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx\appcompat' after 10 attempts

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

* Get more help at https://help.gradle.org

BUILD FAILED in 47s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! OnMyWay@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the OnMyWay@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2020-07-18T03_05_08_404Z-debug.log

【问题讨论】:

    标签: reactjs react-native react-native-image-picker


    【解决方案1】:

    你需要清理项目

    构建 > 清理项目

    然后再次构建您的项目

    【讨论】:

    • 我试过 cd android && ./gradlew cleanBuildCache a 并且成功了!!感谢您的建议。在此之前尝试了github.com/facebook/react-native/issues/27443 中提到的所有内容,但没有任何效果。非常感谢
    猜你喜欢
    • 2019-09-08
    • 1970-01-01
    • 1970-01-01
    • 2013-08-06
    • 1970-01-01
    • 2021-10-20
    • 2021-09-12
    • 2021-08-30
    • 2021-02-16
    相关资源
    最近更新 更多