React Native app not running without doing anything in the previous working code - react-native

I am currently woking in a react native projects
It have these packages as dependencies
"dependencies": {
"#react-native-async-storage/async-storage": "^1.15.5",
"#react-native-community/checkbox": "^0.5.8",
"#react-native-community/cli": "^7.0.3",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/datetimepicker": "^3.5.2",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-picker/picker": "^1.16.3",
"#react-navigation/drawer": "^5.12.5",
"#react-navigation/material-top-tabs": "^5.3.15",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.5",
"#twotalltotems/react-native-otp-input": "^1.3.11",
"axios": "^0.21.1",
"axios-oauth-client": "^1.4.2",
"axios-token-interceptor": "^0.2.0",
"moment": "^2.29.1",
"prop-types": "^15.8.1",
"react": "17.0.1",
"react-native": "0.64.1",
"react-native-animatable": "^1.3.3",
"react-native-app-intro-slider": "^4.0.4",
"react-native-calendars": "^1.1264.0",
"react-native-cardview": "^2.0.5",
"react-native-date-picker": "^4.2.1",
"react-native-device-info": "^8.1.3",
"react-native-eject": "^0.1.2",
"react-native-geolocation-service": "^5.3.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-get-random-values": "^1.8.0",
"react-native-image-picker": "^4.0.3",
"react-native-material-dropdown": "^0.11.1",
"react-native-modal-datetime-picker": "^10.2.0",
"react-native-modal-picker": "^0.0.16",
"react-native-pager-view": "^5.4.23",
"react-native-phone-number-input": "^2.1.0",
"react-native-picker-select": "^8.0.4",
"react-native-reanimated": "^2.2.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.3.0",
"react-native-searchable-dropdown": "^1.1.3",
"react-native-signature-canvas": "^4.3.0",
"react-native-simple-toast": "^1.1.4",
"react-native-slider": "^0.11.0",
"react-native-step-indicator": "^1.0.3",
"react-native-tab-view": "^2.16.0",
"react-native-text-input-mask": "^3.1.4",
"react-native-vector-icons": "^9.1.0",
"react-native-webview": "^11.13.0",
"react-redux": "^7.2.4",
"uuid": "^8.3.2"
},
It is not running now without doing anything with the previous working code, not even updating anything in the system also.
Here is that error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/username/.gradle/caches/modules-2/files-2.1/com.facebook.react/react-native/0.71.0-rc.0/7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543/react-native-0.71.0-rc.0-debug.aar.
> Java heap space
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 4s
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
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/username/.gradle/caches/modules-2/files-2.1/com.facebook.react/react-native/0.71.0-rc.0/7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543/react-native-0.71.0-rc.0-debug.aar.
> Java heap space
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 4s
at makeError (/Users/username/Desktop/Gitlab/projectname/node_modules/execa/index.js:174:9)
at /Users/username/Desktop/Gitlab/projectname/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/username/Desktop/Gitlab/projectname/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/Users/username/Desktop/Gitlab/projectname/node_modules/#react-native-community/cli/build/index.js:192:9)

There is some issues in the react-native itself.
solution to this issue - https://github.com/facebook/react-native/issues/35210
For react-native ( >= 0.63)
In android/build.gradle add this exclusiveContent inside the allprojects.repositories
allprojects {
repositories {
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
// ...
}
}
For older react-native (< 0.63)
Add this in the allprojects area of your android/buld.gradle file.
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}

I am also facing this issue, the last time I built the app, everything worked fine, but just yesterday, the build started failing with this same error. No changes or updates were made.

Related

How to solve Build failed in react native?

here is my problem or error I'm facing please click here to see...
Here is my node error in metro bundler..
#######
################
######### #########
######### ##########
######### ###### #########
##########################################
##### ##################### #####
##### ############## #####
##### ### ###### ### #####
##### ####### ####### #####
##### ########### ########### #####
##### ########################## #####
##### ########################## #####
##### ###################### ######
###### ############# #######
######### #### #########
######### #########
######### #########
#########
Welcome to Metro!
Fast - Scalable - Integrated
To reload the app press "r"
To open developer menu press "d"
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:140:10)
at stableHash (D:\EMproject\eMembership-React-Native\node_modules\metro-cache\src\stableHash.js:19:8)
at Object.getCacheKey (D:\EMproject\eMembership-React-Native\node_modules\metro-transform-worker\src\index.js:593:7)
at getTransformCacheKey (D:\EMproject\eMembership-React-Native\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19)
at new Transformer (D:\EMproject\eMembership-React-Native\node_modules\metro\src\DeltaBundler\Transformer.js:48:9)
at D:\EMproject\eMembership-React-Native\node_modules\metro\src\Bundler.js:22:29 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
This is an error I'm getting ...
PS D:\EMproject\eMembership-React-Native> npm run android
eMembershipCard#0.0.4 android
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 3139 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'eMembershipCard'.
Could not resolve all files for configuration ':classpath'.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
Required by:
project :
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 15s
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'eMembershipCard'.
Could not resolve all files for configuration ':classpath'.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
Required by:
project :
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 15s
at makeError (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
PS D:\EMproject\eMembership-React-Native>
Here is my package.json file...
{
"name": "eMembershipCard",
"version": "0.0.4",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"android_emembershipcard": "react-native run-android --variant=emembershipcardDebug --appIdSuffix = 'membershipdemo' ",
"android_omaha": "react-native run-android --variant=omahaDebug --appIdSuffix = 'ocm' ",
"android_magichouse": "react-native run-android --variant=magichouseDebug --appIdSuffix = 'magichouse' ",
"ios_emembershipcard": "react-native run-ios --scheme eMembershipCard --configuration eMembershipCard",
"ios_omaha": "react-native run-ios --scheme omaha --configuration omaha",
"ios_magichouse": "react-native run-ios --scheme magichouse --configuration magichouse",
"emembership-build": "cd android && ./gradlew assembleemembershipcardRelease",
"emembership-build-debug": "cd android && ./gradlew assembleemembershipcardDebug",
"omaha-build-debug": "cd android && ./gradlew assembleomahaDebug",
"magichouse-build-debug": "cd android && ./gradlew assemblemagichouseDebug",
"emembership-build-debug-bundle": "cd android && ./gradlew bundleemembershipcardDebug",
"omaha-build-debug-bundle": "cd android && ./gradlew bundleomahaDebug",
"magichouse-build-debug-bundle": "cd android && ./gradlew bundlemagichouseDebug"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
What I have tried...
I think the commands which is necessary to solve the error I have tried ...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
**Here is my android/build.gradle ...
`
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlin_version = '1.7.20'
android_plugin_version = '7.3.1'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.3.1')
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
`

How to solve the Build failed with an exception in React Native

This is an error I'm facing
BUILD FAILED in 1m 33s
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.bat app:installEmembershipcardDebug -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
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\art\android\src\main\java\com\reactnativecommunity\art\ARTGroupShadowNode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-camera\android\src\main\java\com\google\android\cameraview\Camera2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\#react-native-firebase\messaging\android\src\main\java\io\invertase\firebase\messaging\ReactNativeFirebaseMessagingModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-html-to-pdf\android\src\main\java\android\print\PdfConverter.java uses or
overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-safe-area-context\android\src\main\java\com\th3rdwave\safeareacontext\InsetsChangeEvent.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-share\android\src\main\java\cl\json\RNSharePathUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: D:\ememberProject\eMembership-React-Native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\CustomSearchView.kt: (8, 76): Type mismatch: inferred type is Context? but Context was expected
Note: D:\ememberProject\eMembership-React-Native\node_modules\react-native-svg\android\src\main\java\com\horcrux\svg\VirtualView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 1m 33s
at makeError (D:\ememberProject\eMembership-React-Native\node_modules\execa\index.js:174:9)
at D:\ememberProject\eMembership-React-Native\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\ememberProject\eMembership-React-Native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
PS D:\ememberProject\eMembership-React-Native>
This is an android/build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlin_version = '1.7.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
What I have tried...
I think the commands which is necessary to solve the error I almost tried to solve...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
Package.json
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.69.1",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.14.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
versions...
PS D:\ememberProject\eMembership-React-Native> npm version
"
eMembershipCard: '0.0.4',
npm: '9.1.3',
node: '19.1.0',
v8: '10.7.193.20-node.19',
uv: '1.44.2',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '111',
nghttp2: '1.47.0',
napi: '8',
llhttp: '8.1.0',
openssl: '3.0.7+quic',
cldr: '42.0',
icu: '72.1',
tz: '2022e',
unicode: '15.0',
ngtcp2: '0.8.1',
nghttp3: '0.7.0' "
Looks like it is your case https://github.com/software-mansion/react-native-screens/issues/1449
Check versions of your RN and Screens libs react-native-screens#3.14.0 and react-native#0.69.1

React Native : Error cannot find symbol com.swmansion.gesturehandler.react.RNGestureHandlerPackage

I know that many related problems already asked but still none of them worked.
Error :
> Configure project :react-native-firebase_firestore
:react-native-firebase_firestore package.json found at /home/username/StudioProjects/agl-admin/node_modules/#react-native-firebase/firestore/package.json......
> Task :app:compileDebugJavaWithJavac FAILED
/home/username/StudioProjects/agl-admin/android/app/src/main/java/com/agladmin/MainApplication.java:12: error: cannot find symbol
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
^
symbol: class RNGestureHandlerPackage
location: package com.swmansion.gesturehandler.react
/home/username/StudioProjects/agl-admin/android/app/src/main/java/com/agladmin/MainApplication.java:49: error: cannot find symbol
packages.add(new RNGestureHandlerPackage());
^
symbol: class RNGestureHandlerPackage
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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.
....
Most Matching Question : " com.swmansion.gesturehandler.react" ERROR APPEARS
package.json
{
"name": "agl-admin",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"#expo-google-fonts/poppins": "^0.2.2",
"#react-native-firebase/app": "^14.5.1",
"#react-native-firebase/firestore": "^14.5.1",
"#react-navigation/drawer": "^6.3.1",
"#react-navigation/native": "^6.0.8",
"#react-navigation/stack": "^6.1.1",
"expo": "~44.0.2",
"expo-app-loading": "^1.3.0",
"expo-font": "~10.0.4",
"expo-splash-screen": "~0.14.1",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-gesture-handler": "^2.3.2",
"react-native-paper": "^4.11.2",
"react-native-reanimated": "^2.4.1",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-splash-screen": "^3.3.0",
"react-native-web": "0.17.1",
"react-navigation": "^4.4.4"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}
What I've :
In android\settings.gradle include ':react-native.... these two where already there
In MainAplication.java import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; already there
and new RNGestureHandlerPackage() List was not there so i added.
rm -rf node_modules
npm cache clean --force
./gradlew clean
and then reinstall all.
=============== UPDATE =================
I fixed it by React downgrading to "react-native-gesture-handler": "~2.1.3"
and resting cache. T
In the new version (RNGH 2) you have to remove .react, so it's just import com.swmansion.gesturehandler.RNGestureHandlerPackage;!
Make sure added you add react-native-reanimated plugin into babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['react-native-reanimated/plugin'],
};

why the app doesnt works after install react native navigation module?

well, there is no error before I executed this command: "npm install #react-navigation/native". After I installed this module, when I execute app in android emulator react native app doesnt works. there is no problem on my node.js, npm, android_home,android sdk.
BUILD FAILED in 10s
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
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDebugBuild'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Failed to transform artifact 'react-native-reanimated-61.aar (project :react-native-reanimated)' to match attributes {artifactType=android-manifest}.
> Execution failed for JetifyTransform: C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\react-native-reanimated\android\react-native-reanimated-61.aar.
> Failed to transform 'C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\react-native-reanimated\android\react-native-reanimated-61.aar' using Jetifier. Reason: Cannot open a library at 'FileMapping(from=C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\react-native-reanimated\android\react-native-reanimated-61.aar, to=C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\react-native-reanimated\android\build.transforms\c66aa8e9da80f2493bdea3fa761dc58e\jetified-react-native-reanimated-61.aar)'. (Run with --stacktrace for more details.)
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 10s
at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at then.result (C:\Users\JohnH\Desktop\ReactNative Coding\ReactNative\react_native_navigation_01\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12)
package.json
{
"name": "react_native_navigation_01",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.1.1"
},
"devDependencies": {
"#babel/core": "7.13.15",
"#babel/runtime": "7.13.10",
"#react-native-community/eslint-config": "0.0.5",
"babel-jest": "24.9.0",
"eslint": "6.8.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.4",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
I had the same problem today. Since we need to install react-native-reanimated I did check its docs and they aren't supporting react-native < v0.62 and you are using "react-native": "0.61.5" in your package.json.
Try upgrading your react-native dependency. It worked for me. Good luck!
Reference: https://docs.swmansion.com/react-native-reanimated/docs

React Native run-android doesn't work - package com.facebook.react.module.annotations does not exist

I get the following error when i try to run react-native run-android:
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
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:20: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogModule.java:29: error: cannot find symbol
#ReactModule(name = RNDatePickerDialogModule.FRAGMENT_TAG)
^
symbol: class ReactModule
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNTimePickerDialogModule.java:21: error: package com.facebook.react.module.annotations does not exist
import com.facebook.react.module.annotations.ReactModule;
^
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNTimePickerDialogModule.java:29: error: cannot find symbol
#ReactModule(name = RNTimePickerDialogModule.FRAGMENT_TAG)
^
symbol: class ReactModule
D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDateTimePickerPackage.java:12: error: RNDateTimePickerPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNDateTimePickerPackage implements ReactPackage {
^
Note: D:\Work\CS\CSMobile\node_modules\#react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDatePickerDialogFragment.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
5 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-community_datetimepicker:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 3s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at D:\Work\CS\CSMobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (D:\Work\CS\CSMobile\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)
PS D:\Work\CS\CSMobile>
My dependencies:
"dependencies": {
"#eva-design/eva": "^1.2.0",
"#react-native-community/datetimepicker": "2.1.0",
"#types/html-entities": "^1.2.16",
"#types/object-hash": "^1.3.1",
"#types/react-native-material-textfield": "^0.16.3",
"#types/uuid": "^3.4.7",
"axios": "^0.19.2",
"date-fns": "^2.10.0",
"html-entities": "^1.2.1",
"object-hash": "^2.0.2",
"react": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-elements": "^1.2.7",
"react-native-flash-message": "^0.1.15",
"react-native-gesture-handler": "~1.5.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-modal-datetime-picker": "^8.5.1",
"react-native-reanimated": "~1.4.0",
"react-native-router-flux": "^4.2.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-svg": "9.13.3",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.9.4",
"react-navigation-tabs": "^2.5.6",
"react-redux": "^7.1.3",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"uuid": "^3.4.0"
},
I tried to remove package-lock.json and node-modules then reinstall, but still receiving same errors.
I was working on this exact same project on expo, everything works perfectly. However, when i try to clone the project to a pure react-native project, then this error occurs.
Anyone knows how to solve this? Many thanks!
Install #react-native-community/datetimepicker latest version
npm install #react-native-community/datetimepicker --save
then clean gradlew
cd android && gradlew clean
then run the app again
cd.. && react-native run-android