【问题标题】:My react native project cannot build after rename project重命名项目后我的反应原生项目无法构建
【发布时间】:2021-12-23 11:39:59
【问题描述】:

我尝试重命名我的应用,因为我需要它,但重命名后出现问题(重命名之前它工作正常)。我遵循了这条指令:https://dev.to/abdulbasit313/proper-way-to-rename-a-react-native-project-in-2019-3b98 但是当我运行时,构建失败

我正在使用 react native 0.59.9

这是错误:

info Starting JS server...
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
> Task :app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.yalantis:ucrop:2.2.2-native.
     Searched in the following locations:
       - file:/C:/Users/ASUS/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - file:/C:/Users/ASUS/.m2/repository/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
       - file:/D:/3-SIMASA/simasamobile/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.pom
       - file:/D:/3-SIMASA/simasamobile/node_modules/react-native/android/com/github/yalantis/ucrop/2.2.2-native/ucrop-2.2.2-native.jar
     Required by:
         project :app > project :react-native-image-crop-picker

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 7s
21 actionable tasks: 20 executed, 1 up-to-date
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

【问题讨论】:

    标签: react-native


    【解决方案1】:

    上述解决方案不正确,因为它会清除您的链接库...您可以通过更改 android/src/main/res/values/strings.xml 中的 name 轻松重命名 android 项目。同样在 iOS 上,您可以通过在 Xcode 中打开 ios/your_project.xcodeproj 来更改名称,并在项目设置的 General 选项卡中修改 Display Name

    【讨论】:

      【解决方案2】:

      请重新安装并重新链接库。这将解决问题。

      react-native-image-crop-picker

      另外请参考here如何更简单地重命名项目。

      【讨论】:

        猜你喜欢
        • 2019-11-19
        • 2020-01-23
        • 2022-10-23
        • 2020-05-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-17
        • 1970-01-01
        相关资源
        最近更新 更多