facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.12k stars 24.32k forks source link

Build issue in React Native version 0.66.4 #35220

Closed neeteshraj closed 2 years ago

neeteshraj commented 2 years ago

Description

My project is currently running on React Native 0.66.4. I have used typescript@6.8 as a template for the project. Project was created using the Command: npx react-native init testproj --template react-native-template-typescript@6.8

It was building fine till yesterday. Suddenly the building stopped. I tried to create a new project to check if it is the probem with my project only or it is the problem with react native. Any newly created project with the given command stopped building on any of my machine. I tried building it on my M1 MACBOOK PRO, 8GB RAM and Windows 10 laptop.

Is anyone else facing the same issue while building the application on react native 0.66.4 ?

Latest version of react native builds without any issue.

Here is the error message:

❯ yarn android yarn run v1.22.18 warning ../../../package.json: No license field $ react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1506 file(s) to forward-jetify. Using 8 workers... info JS server already running. info Installing the app...

Configure project :react-native-bluetooth-escpos-printer WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed in version 7.0 of the Android Gradle plugin. For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

Configure project :react-native-reanimated AAR for react-native-reanimated has been found /Users/niteshrajkhanal/Desktop/pharma-ts/pharmasoultionreactnative/node_modules/react-native-reanimated/android/react-native-reanimated-66-jsc.aar WARNING:: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2. Android SDK Build Tools 30.0.2 will be used. To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Task :app:checkDebugAarMetadata FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings 19 actionable tasks: 3 executed, 16 up-to-date 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/addon2/03 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/repository2/03 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/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/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.

BUILD FAILED in 1m 40s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew 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/addon2/03 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/repository2/03 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/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/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.

BUILD FAILED in 1m 40s

at makeError (/Users/niteshrajkhanal/Desktop/pharma-ts/pharmasoultionreactnative/node_modules/execa/index.js:174:9)
at /Users/niteshrajkhanal/Desktop/pharma-ts/pharmasoultionreactnative/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (/Users/niteshrajkhanal/Desktop/pharma-ts/pharmasoultionreactnative/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/niteshrajkhanal/Desktop/pharma-ts/pharmasoultionreactnative/node_modules/@react-native-community/cli/build/index.js:192:9)

info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Version

0.66.4

Output of npx react-native info

System: OS: macOS 12.6 CPU: (8) arm64 Apple M1 Memory: 102.61 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.8.0 - /opt/homebrew/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 8.18.0 - /opt/homebrew/bin/npm Watchman: 2022.09.05.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild Languages: Java: 11.0.16.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.4 => 0.66.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Building the project reproduces the issue in react native version 0.66.4

Snack, code example, screenshot, or link to a repository

Screen Shot 2022-11-06 at 3 06 45 PM Screen Shot 2022-11-06 at 3 06 54 PM
sunnylqm commented 2 years ago

see the pinned issue https://github.com/facebook/react-native/issues/35210

neeteshraj commented 2 years ago

see the pinned issue #35210

It worked thank you 👍🚀