Run gradlew -> Error: Cannot find module '../cache-contexts'

I use sdk 41. How I can resolve it ?

this is the logs:

Run gradlew

Running './gradlew :app:bundleRelease' in /build/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-6.8-all.zip
Unzipping /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002/gradle-6.8-all.zip to /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-6.8-all/9emh0d32e025cam7aasxcw002/gradle-6.8/bin/gradle
Welcome to Gradle 6.8!
Here are the highlights of this release:
 - Faster Kotlin DSL script compilation
 - Vendor selection for Java toolchains
 - Convenient execution of tasks in composite builds
 - Consistent dependency resolution
For more details see https://docs.gradle.org/6.8/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.8/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Configure project :app
Installing unimodules:
 unimodules-core@7.1.1 from /build/workingdir/build/node_modules/@unimodules/core
 unimodules-react-native-adapter@6.2.2 from /build/workingdir/build/node_modules/@unimodules/react-native-adapter
 expo-app-auth@10.1.2 from /build/workingdir/build/node_modules/expo-app-auth
expo-application@3.1.2 from /build/workingdir/build/node_modules/expo-application
 expo-av@9.1.2 from /build/workingdir/build/node_modules/expo-av
 unimodules-permissions-interface@6.2.0 from /build/workingdir/build/node_modules/expo-camera/node_modules/unimodules-permissions-interface
 expo-camera@11.0.3 from /build/workingdir/build/node_modules/expo-camera
 expo-constants@10.1.3 from /build/workingdir/build/node_modules/expo-constants
expo-error-recovery@2.1.0 from /build/workingdir/build/node_modules/expo-error-recovery
 expo-facebook@11.0.5 from /build/workingdir/build/node_modules/expo-facebook
 expo-file-system@11.0.2 from /build/workingdir/build/node_modules/expo-file-system
expo-font@9.1.0 from /build/workingdir/build/node_modules/expo-font
expo-image-loader@2.1.1 from /build/workingdir/build/node_modules/expo-image-loader
 expo-image-picker@10.1.4 from /build/workingdir/build/node_modules/expo-image-picker
 expo-keep-awake@9.1.2 from /build/workingdir/build/node_modules/expo-keep-awake
 expo-linear-gradient@9.1.0 from /build/workingdir/build/node_modules/expo-linear-gradient
 expo-localization@10.1.0 from /build/workingdir/build/node_modules/expo-localization
expo-media-library@12.0.2 from /build/workingdir/build/node_modules/expo-media-library
 expo-permissions@12.0.1 from /build/workingdir/build/node_modules/expo-permissions
 expo-secure-store@10.1.0 from /build/workingdir/build/node_modules/expo-secure-store
 expo-splash-screen@0.10.3 from /build/workingdir/build/node_modules/expo-splash-screen
expo-sqlite@9.1.0 from /build/workingdir/build/node_modules/expo-sqlite
 expo-structured-headers@1.0.1 from /build/workingdir/build/node_modules/expo-structured-headers
 expo-updates@0.5.5 from /build/workingdir/build/node_modules/expo-updates
 unimodules-app-loader@2.1.0 from /build/workingdir/build/node_modules/unimodules-app-loader
 unimodules-barcode-scanner-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-barcode-scanner-interface
unimodules-camera-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-camera-interface
unimodules-constants-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-constants-interface
unimodules-face-detector-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-face-detector-interface
 unimodules-file-system-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-file-system-interface
 unimodules-font-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-font-interface
unimodules-image-loader-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-image-loader-interface
unimodules-sensors-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-sensors-interface
 unimodules-task-manager-interface@6.1.0 from /build/workingdir/build/node_modules/unimodules-task-manager-interface
Found some duplicated unimodule packages. Installed the ones with the highest version number.
Make sure following dependencies of your project are resolving to one specific version:
unimodules-permissions-interface

[…delete some log messages due to too long post…]

> Task :unimodules-core:generateReleaseRFile
> Task :unimodules-app-loader:generateReleaseRFile
> Task :unimodules-app-loader:javaPreCompileRelease
> Task :unimodules-core:generateReleaseBuildConfig
> Task :app:bundleReleaseJsAndAssets FAILED
TypeError: Cannot read property 'transformFile' of undefined
    at /build/workingdir/build/node_modules/metro/src/Bundler.js:91:34
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/build/workingdir/build/node_modules/metro/src/Bundler.js:14:24)
    at _next (/build/workingdir/build/node_modules/metro/src/Bundler.js:34:9)

[stderr]

Failed to construct transformer:  Error: Cannot find module '../cache-contexts'

[stderr]

Require stack:

[stderr]

- /build/workingdir/build/node_modules/@babel/core/lib/config/helpers/config-api.js

[stderr]

- /build/workingdir/build/node_modules/@babel/core/lib/config/files/configuration.js

[stderr]

- /build/workingdir/build/node_modules/@babel/core/lib/config/files/index.js

[stderr]

- /build/workingdir/build/node_modules/@babel/core/lib/index.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/JSTransformer/worker.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/DeltaBundler/Transformer/getTransformCacheKey.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/DeltaBundler/Transformer.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/Bundler.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/IncrementalBundler.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/Server.js

[stderr]

- /build/workingdir/build/node_modules/metro/src/shared/output/bundle.js

[stderr]

- /build/workingdir/build/node_modules/@react-native-community/cli/build/commands/bundle/buildBundle.js

[stderr]

- /build/workingdir/build/node_modules/@react-native-community/cli/build/commands/bundle/bundle.js

[stderr]

- /build/workingdir/build/node_modules/@react-native-community/cli/build/commands/index.js

[stderr]

- /build/workingdir/build/node_modules/@react-native-community/cli/build/index.js

[stderr]

- /build/workingdir/build/node_modules/@react-native-community/cli/build/bin.js

[stderr]

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)

[stderr]

    at Function.Module._load (internal/modules/cjs/loader.js:730:27)

[stderr]

    at Module.require (internal/modules/cjs/loader.js:957:19)

[stderr]

    at Module.patchedRequire [as require] (/build/workingdir/build/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)

[stderr]

    at require (internal/modules/cjs/helpers.js:88:18)

[stderr]

    at Object.<anonymous> (/build/workingdir/build/node_modules/@babel/core/lib/config/helpers/config-api.js:24:15)

[stderr]

    at Module._compile (internal/modules/cjs/loader.js:1068:30)

[stderr]

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)

[stderr]

    at Module.load (internal/modules/cjs/loader.js:933:32)

[stderr]

    at Function.Module._load (internal/modules/cjs/loader.js:774:14) {

[stderr]

  code: 'MODULE_NOT_FOUND',

[stderr]

  requireStack: [

[stderr]

    '/build/workingdir/build/node_modules/@babel/core/lib/config/helpers/config-api.js',

[stderr]

    '/build/workingdir/build/node_modules/@babel/core/lib/config/files/configuration.js',

[stderr]

    '/build/workingdir/build/node_modules/@babel/core/lib/config/files/index.js',

[stderr]

    '/build/workingdir/build/node_modules/@babel/core/lib/index.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/JSTransformer/worker.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/DeltaBundler/Transformer/getTransformCacheKey.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/DeltaBundler/Transformer.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/Bundler.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/IncrementalBundler.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/Server.js',

[stderr]

    '/build/workingdir/build/node_modules/metro/src/shared/output/bundle.js',

[stderr]

    '/build/workingdir/build/node_modules/@react-native-community/cli/build/commands/bundle/bundle.js',

[stderr]

    '/build/workingdir/build/node_modules/@react-native-community/cli/build/commands/bundle/buildBundle.js',

[stderr]

    '/build/workingdir/build/node_modules/@react-native-community/cli/build/commands/index.js',

[stderr]

    '/build/workingdir/build/node_modules/@react-native-community/cli/build/index.js',

[stderr]

    '/build/workingdir/build/node_modules/@react-native-community/cli/build/bin.js'

[stderr]

  ]

[stderr]

}

[stderr]

error Cannot read property 'transformFile' of undefined. Run CLI with --verbose flag for more details.
> Task :unimodules-core:compileReleaseKotlin

[stderr]

FAILURE: Build failed with an exception.

[stderr]

* What went wrong:

[stderr]

Execution failed for task ':app:bundleReleaseJsAndAssets'.

[stderr]

> Process 'command 'node'' finished with non-zero exit value 1

[stderr]

* Try:

[stderr]

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.

[stderr]

* Get more help at https://help.gradle.org

[stderr]

BUILD FAILED in 1m 42s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
296 actionable tasks: 296 executed
Use '--warning-mode all' to show the individual deprecation warnings.
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

eas.json
{
“build”: {
“release”: {
“distribution”: “store”,
“expoCli”: “4.12.0”,
“yarn”: “1.22.10”,
“node”: “14.17.0”,
“releaseChannel”: “tdw”,
“android”: {
},
“ios”: {
}
}
},
“submit”: {
“release”: {
“android”: {
“serviceAccountKeyPath”: “certificati/pc-api-xxxx.json”,
“track”: “internal”
},
“ios”: {
“appleId”: “info@xxx”,
“ascAppId”: “xx”,
“appleTeamId”: “xxxx”,
“language”: “it-IT”,
“companyName”: “xxxx”
}
}
}
}

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.