Skip to content

执行npx react-native run-android时,报错:error Failed to install the app #958

@p-oy

Description

@p-oy

请按以下格式提供问题的相关信息。

在启动RN项目时遇到错误,如下

  • 执行npx react-native run-android报错:具体如下
    FAILURE: Build failed with an exception.

Where:
Script 'D:\oyp\smallWorld\GIT\react-native-smallworld\node_modules\lottie-react-native\src\android\gradle-maven-push.gradle' line: 97

What went wrong:
A problem occurred configuring project ':lottie-react-native'.

Installed Build Tools revision 33.0.1 is corrupted. Remove and install again using the SDK Manager.

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 20s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

  • 报错截图

Image

请描述完整的环境/版本信息

System:
OS: Windows 10 10.0.22631
CPU: (8) x64 Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Memory: 4.18 GB / 15.92 GB
Binaries:
Node: 14.21.3 - D:\oyp\Node\nodejs\node.EXE
Yarn: 1.22.22 - D:\oyp\Node\nodejs\yarn.CMD
npm: 6.14.18 - D:\oyp\Node\nodejs\npm.CMD
npmPackages:
react: 16.9.0 => 16.9.0
react-native: git+https://gitlab.x.yunio.com/app/react-native/plugin/react-native.git#v0.61.5-update => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1

预期结果

  • SDK33.0.1版本重新下载很多次还是不行,不知道哪里问题,大佬们帮忙看看这是什么问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions