I follow react-navigation docs, but it doesn't work, Mainly "react-native-screens" - react-native

this is my package.json:
{
"name": "awesomeproject1",
"version": "0.0.1",
"private": true,
"scripts": {
"a": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.11",
"#react-navigation/native": "^5.9.8",
"#react-navigation/native-stack": "^6.2.5",
"react": "16.8.1",
"react-native": "0.61.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.9.0",
"react-native-tab-navigator": "^0.3.4"
},
"devDependencies": {
"#babel/core": "^7.5.0",
"#babel/runtime": "^7.5.0",
"#react-native-community/eslint-config": "^0.0.3",
"babel-jest": "^24.1.0",
"jest": "^24.1.0",
"metro-react-native-babel-preset": "^0.51.1",
"react-test-renderer": "16.8.1"
},
"jest": {
"preset": "react-native"
}
}
when npm run a,
PS I:\loan> npm run a
> awesomeproject1#0.0.1 a I:\loan
> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 971 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Installing the app...
> Task :react-native-screens:compileDebugKotlin FAILED
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.5/userguide/command_line_interface.html#sec:command_line_warnings
62 actionable tasks: 18 executed, 44 up-to-date
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (20, 38): Unresolved reference: ReactTypefaceUtils
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (206, 37): Unresolved reference: ReactTypefaceUtils
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (325, 28): Unresolved reference: ReactTypefaceUtils
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> 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 41s
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
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (20, 38): Unresolved reference: ReactTypefaceUtils
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (206, 37): Unresolved reference: ReactTypefaceUtils
e: I:\loan\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (325, 28): Unresolved reference: ReactTypefaceUtils
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> 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 41s
at checkExecSyncError (child_process.js:790:11)
at execFileSync (child_process.js:827:15)
at runOnAllDevices (I:\loan\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (I:\loan\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at I:\loan\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command.handleAction (I:\loan\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! awesomeproject1#0.0.1 a: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the awesomeproject1#0.0.1 a 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\Yiming\AppData\Roaming\npm-cache\_logs\2021-11-23T09_11_23_054Z-debug.log
Please!!!How to solve it...
this is build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
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()
jcenter()
maven { url 'https://jitpack.io' }
}
}

this is right version,
{
"name": "awesomeproject1",
"version": "0.0.1",
"private": true,
"scripts": {
"a": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.6",
"#react-navigation/bottom-tabs": "^5.11.15",
"#react-navigation/native": "^5.0.2",
"#react-navigation/stack": "5.x",
"i": "^0.3.7",
"npm": "^8.1.4",
"prop-types": "^15.7.2",
"react": "16.8.1",
"react-native": "0.61.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^3.1.0-beta.1",
"react-native-screens": "^2.0.0-beta.2",
"react-native-vector-icons": "^9.0.0"
},
"devDependencies": {
"#babel/core": "^7.5.0",
"#babel/runtime": "^7.5.0",
"#react-native-community/eslint-config": "^0.0.3",
"babel-jest": "^24.1.0",
"jest": "^24.1.0",
"metro-react-native-babel-preset": "^0.51.1",
"react-test-renderer": "16.8.1"
},
"jest": {
"preset": "react-native"
}
}

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' }
}
}
`

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'],
};

How to overcome ERESOLVE errors within EAS build for native-base and Expo?

I have got the following package.json file. Main purpose is to use Expo 44 with native-base (version ^3.0.0). I could not figure out why such an obvious combination does not work. (Could not find online for native-base, which Expo versions are recommended either.)
package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"dependencies": {
"#expo/samples": "2.1.1",
"#expo/vector-icons": "^12.0.0",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/datetimepicker": "4.0.0",
"#react-native-community/netinfo": "7.1.3",
"#react-native-picker/picker": "2.2.1",
"expo": "^44.0.0",
"expo-ads-admob": "~12.0.0",
"expo-app-loading": "~1.3.0",
"expo-apple-authentication": "~4.1.0",
"expo-application": "~4.0.1",
"expo-asset": "~8.4.5",
"expo-auth-session": "~3.5.0",
"expo-av": "~10.2.0",
"expo-facebook": "~12.1.0",
"expo-font": "~10.0.4",
"expo-haptics": "~11.1.0",
"expo-image-manipulator": "~10.2.0",
"expo-random": "~12.1.1",
"expo-screen-orientation": "~4.1.1",
"expo-sharing": "~10.1.0",
"expo-tracking-transparency": "~2.1.0",
"moment": "^2.24.0",
"native-base": "^3.0.0",
"react": "17.0.1",
"react-native": "0.64.3",
"react-native-gesture-handler": "~2.1.0",
"react-native-modal-datetime-picker": "^8.6.0",
"react-native-picker-select": "^8.0.0",
"react-native-progress": "^4.1.2",
"react-native-progress-circle": "^2.1.0",
"react-native-safe-area-context": "3.3.2",
"react-native-svg": "12.1.1",
"react-native-view-shot": "3.1.2",
"react-native-webview": "11.15.0",
"react-redux": "^6.0.0",
"redux": "^4.0.1"
},
"devDependencies": {
"babel-preset-expo": "9.0.1"
},
"resolutions": {},
"private": true
}
Even though all the local debugging and simulator runs work without problem, when the EAS try to build, following errors (coming from npm) are seen.
[stderr] npm ERR! code ERESOLVE
[stderr] npm
[stderr] ERR! ERESOLVE unable to resolve dependency tree
[stderr] npm ERR!
[stderr] npm ERR! While resolving: undefined#undefined
[stderr] npm ERR! Found: react#17.0.1
[stderr] npm ERR! node_modules/react
[stderr] npm ERR!
[stderr] react#"17.0.1" from the root project
[stderr] npm ERR! peer react#"*" from native-base#3.3.6
[stderr] npm ERR! node_modules/native-base
[stderr] npm ERR! native-base#"^3.0.0" from the root project
[stderr] npm ERR!
[stderr] npm ERR! Could not resolve dependency:
[stderr] npm ERR! peer react#"17.0.2" from react-dom#17.0.2
[stderr] npm ERR! node_modules/react-dom
[stderr] npm ERR! peer react-dom#"*" from native-base#3.3.6
[stderr] npm ERR! node_modules/native-base
[stderr] npm ERR! native-base#"^3.0.0" from the root project
[stderr] npm ERR!
[stderr] npm ERR! Fix the upstream dependency conflict, or retry
[stderr] npm ERR! this command with --force, or --legacy-peer-deps
[stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
[stderr] npm ERR!
[stderr] npm ERR! See /Users/expo/.npm/eresolve-report.txt for a full report.
[stderr]
[stderr] npm ERR! A complete log of this run can be found in:
[stderr] npm ERR! /Users/expo/.npm/_logs/2022-02-14T09_22_49_729Z-debug.log
npm exited with non-zero code: 1
How to overcome this problem, any ideas?
Chronology:
native-base was added into the project back in 2019, with "^2.10.0" version.
When upgrading to "expo": "^44.0.0" it required the native-base to be upgraded also, around 2021-12.
At 2021-12, native-base is upgraded to "native-base": "^3.0.0"
It was working up until recently, including EAS builds.
Just recently, after 2022-02-12, for some other purposes we updated our code, nuked the node_modules and we were republishing via EAS build and submit. But even though the "native-base": "^3.0.0" entry in the package.json did not change, the npm step in the EAS servers started to fail.
Other Info:
which build of the expo is failing android or ios.
ios
commands you are using to build.
eas build --platform ios --non-interactive
which package manager are you in this project ? yarn or npm.
I use yarn but eas build seems using npm
any other things which will be useful to replicate this error.
Unfortunately I don't have any other clue.
I also had similar problem.
I solved it by adding a line in package.json file.
"scripts": {
"eas-build-pre-install": "npm install --save --legacy-peer-deps"
}
It seems native-base searches "react-dom": "*" and could not find it so somehow uses "react-dom": "17.0.2" and it in turn looks for "react": "17.0.2" which conflicts with expo's "react": "17.0.1".
So adding "react-dom": "17.0.1" as dependency solved the problem. By this way "react-dom": "*" finds "react-dom": "17.0.1" which is dependent to Expo's version "react": "17.0.1". (Please let me know if this conclusion is wrong.)
Following are the ones related with native-base and these versions should be used otherwise the npm install fails for Expo 44:
"react-dom": "17.0.1",
"react-native-safe-area-context": "3.1.9",
"react-native-svg": "12.1.0",
Reference: https://github.com/GeekyAnts/NativeBase/issues/4647
As a temporary solution, you can add .npmrc file in your project directory with legacy-peer-deps=true and commit it. But at the end, you have to fix your dependencies.

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-gesture-handler can not be installed and shows compilation error

I initially tried using the react-native-elements for icons and other components. I followed the documentation to set things up but the icons were visible as a cross in a rectangle. During this I linked the vector icons by running "react-native link react-native-vector-icons" and also had added the following in setting.gradle in the android folder of the project:
rootProject.name = 'Vida'
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
includeUnimodulesProjects()
apply from: file("../node_modules/#react-native-community/cli-platform-
android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new
File(rootProject.projectDir,
'../node_modules/react-native-vector-icons/android')
Also the mainApplication.java file needed changes so I changed it to following:
#Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
package.add(new RNGestureHandlerPackage()); // THis is the change I made for handling gestures.
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage() // THis is the change for vector Icons
);
}
I also added the
implementation project(':react-native-vector-icons')
implementation project(':react-native-gesture-handler')
to build.gradle file.
After I restarted the app by first "react-native start" and "react-native run-android" and I came across "null is not an object ( evaluating 'RNGestureHandlerModule.default.Direction')" in my android emulator after which I tried searching online for solution and some saidn unistalling and reinstalling react-native-gesture-handlers will solve it so I tried uninstalling and reinstalling the gesture handler and tried restarting the meteor server and run "react-native run-android". But rather, I came across an error saying:
C:\Vida\VidaApp#20\VidaArchive\android\app\src\main\java\blah\com\MainActivity.java:8:
com.swmansion.gesturehandler.react does not exist
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
^
C:\Vida\VidaApp#20\VidaArchive\android\app\src\main\java\blah\com\MainActivity.java:37:
find symbol
return new RNGestureHandlerEnabledRootView(MainActivity.this);
^
symbol: class RNGestureHandlerEnabledRootView
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 output. Run
with --scan to get full insights.
* Get more help at https://help.gradle.org
eact does not exist
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;;
^ ivity.java:37:
C:\Vida\VidaApp#20\VidaArchive\android\app\src\main\java\blah\com\MainActivity.java:37: error: cannot
find symbol his);
return new RNGestureHandlerEnabledRootView(MainActivity.this);
^
symbol: class RNGestureHandlerEnabledRootView
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.
-debug option
* 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 38s
t-native-commu
at checkExecSyncError (child_process.js:635:11)
at execFileSync (child_process.js:653:15) tive-community
at runOnAllDevices (C:\Vida\VidaApp#20\VidaArchive\node_modules\#react-native-community\cli-platform-
android\build\commands\runAndroid\runOnAly\cli-platformlDevices.js:94:39)
at buildAndRun (C:\Vida\VidaApp#20\VidaArchive\node_modules\#react-native-community\cli-platform-
android\build\commands\runAndroid\index.js:17dules\react-na9:41)
at C:\Vida\VidaApp#20\VidaArchive\node_modules\#react-native-community\cli-platform-
android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (C:\Vida\VidaApp#20\VidaArchive\node_modules\react-
native\node_modules\#react-native-community\cli\build\index.js:182:9)
Also while I tried uninstalling gesture handler, visual studio crashed out and i had to open again and after I launched Vscode I reinstalled gesture-handlers, it showed the following error:
$ ...include ':react-native-gesture-handler'
bash: ...include: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: file-uri-to-path#1.0.0 (node_modules\file-uri-to-
path):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename
'C:\Vida\VidaApp#20\VidaArchive\node_modules\file-uri-to-path' ->
'C:\Vida\VidaApp#20\VidaArchive\node_modules\.file-uri-to-path.DELETE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: nan#2.14.2 (node_modules\nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename
'C:\Vida\VidaApp#20\VidaArchive\node_modules\nan'
-> 'C:\Vida\VidaApp#20\VidaArchive\node_modules\.nan.DELETE'
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Vida\VidaApp#20\VidaArchive\node_modules\#egjs\hammerjs
npm ERR! dest C:\Vida\VidaApp#20\VidaArchive\node_modules\#egjs\.hammerjs.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename
'C:\Vida\VidaApp#20\VidaArchive\node_modules\#egjs\hammerjs' ->
'C:\Vida\VidaApp#20\VidaArchive\node_modules\#egjs\.hammerjs.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Shiri\AppData\Roaming\npm-cache\_logs\2020-10-31T07_52_44_306Z-debug.log
Currently my package.json file is as below:
{
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web"
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/netinfo": "^5.8.1",
"#redux-offline/redux-offline": "^2.6.0-expo.0",
"bootstrap": "^4.5.2",
"expo": "~37.0.3",
"expo-linear-gradient": "~8.1.0",
"expo-screen-orientation": "^1.0.0",
"expo-splash-screen": "^0.2.3",
"expo-updates": "~0.2.0",
"pusher-js": "^7.0.0",
"react": "~16.9.0",
"react-bootstrap": "^1.3.0",
"react-dom": "~16.9.0",
"react-native": "~0.61.5",
"react-native-agora": "^2.9.1-alpha.7",
"react-native-banner-carousel": "^1.0.3",
"react-native-country-list": "^1.0.10",
"react-native-elements": "^3.0.0-alpha.1",
"react-native-gesture-handler": "~1.6.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-textfield": "^0.16.1",
"react-native-reanimated": "~1.7.0",
"react-native-rename": "^2.4.1",
"react-native-safe-area-context": "^1.0.0",
"react-native-screens": "^2.7.0",
"react-native-snap-carousel": "^3.9.0",
"react-native-svg": "11.0.1",
"react-native-unimodules": "~0.9.0",
"react-native-vector-icons": "^7.0.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.5.1",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"socket.io-client": "^2.3.0"
},
"devDependencies": {
"#babel/core": "^7.8.6",
"babel-jest": "~25.2.6",
"babel-preset-expo": "~8.1.0",
"jest": "~25.2.6",
"react-test-renderer": "~16.9.0"
},
"private": true,
"name": "VidaArchive",
"version": "1.0.0"
}
I need this issue to be fixed early because I need to show my work to my seniors. Also I am new to react-native environment, Hence, my concerns are:
How to set up and use react-native vector icons for android (alongwith third party libraries)?
What is this issue, RNGestureHandler?
It says Package react-native-gesture-handler has been ignored because it contains invalid
Reason: Cannot find module 'react-native-gesture-handler\package.json'. What is this and what is causing it so and how can I fix this?