EAS build managed workflow error: Task :expo-screen-capture:compileReleaseKotlin FAILED

There was a problem on running command
eas build --platform android --profile production_android

This is the error log from the expo.dev, in “Run gradlew” section

> Task :expo-screen-capture:compileReleaseKotlin FAILED
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (7, 28): Unresolved reference: ExportedModule
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (8, 28): Unresolved reference: ModuleRegistry
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (9, 28): Unresolved reference: Promise
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (10, 28): Unresolved reference: errors
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (11, 39): Unresolved reference: ActivityProvider
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (12, 39): Unresolved reference: ExpoMethod
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (14, 47): Unresolved reference: ExportedModule
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (16, 43): Unresolved reference: ActivityProvider
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (18, 3): 'getName' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (22, 3): 'onCreate' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (22, 41): Unresolved reference: ModuleRegistry
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (23, 50): Unresolved reference: ActivityProvider
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (24, 28): Unresolved reference: context
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (27, 4): Unresolved reference: ExpoMethod
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (28, 37): Unresolved reference: Promise
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (41, 4): Unresolved reference: ExpoMethod
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (42, 35): Unresolved reference: Promise
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (55, 11): Unresolved reference: CurrentActivityNotFoundException
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (55, 11): An annotation argument must be a compile-time constant
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCaptureModule.kt: (61, 13): Unresolved reference: CurrentActivityNotFoundException
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (5, 28): Unresolved reference: BasePackage
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (6, 28): Unresolved reference: ExportedModule
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (7, 28): Unresolved reference: ViewManager
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (9, 30): Unresolved reference: BasePackage
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (10, 3): 'createExportedModules' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (10, 62): Unresolved reference: ExportedModule
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenCapturePackage.kt: (11, 51): Unresolved reference: ExportedModule
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (19, 28): Unresolved reference: ModuleRegistry
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (20, 39): Unresolved reference: LifecycleEventListener
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (21, 39): Unresolved reference: services
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (22, 39): Unresolved reference: services
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (26, 68): Unresolved reference: ModuleRegistry
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (26, 86): Unresolved reference: LifecycleEventListener
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (29, 38): Unresolved reference: EventEmitter
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (33, 30): Unresolved reference: UIManager
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (34, 45): Unresolved reference: EventEmitter
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (37, 7): 'onChange' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (55, 3): 'onHostResume' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (59, 3): 'onHostPause' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/expo-screen-capture/android/src/main/kotlin/expo/modules/screencapture/ScreenShotEventEmitter.kt: (63, 3): 'onHostDestroy' overrides nothing
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
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
640 actionable tasks: 640 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-screen-capture:compileReleaseKotlin'.

I tried to reinstall node_modules using npm or yarn, but it produces same error.

The project uses managed workflow
Dependency:

  • expo-cli 5.4.7
  • eas-cli/0.53.0 win32-x64 node-v16.14.0

Package.json:

{
  "name": "ndc-ministry",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.1.0",
    "@expo-google-fonts/judson": "^0.1.0",
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo-google-fonts/noto-sans": "^0.1.0",
    "@expo-google-fonts/open-sans": "^0.1.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/datetimepicker": "3.5.2",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "6.0.2",
    "@react-native-community/slider": "4.1.12",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "@unimodules/core": "~7.2.0",
    "@unimodules/react-native-adapter": "~6.5.0",
    "buffer": "^6.0.3",
    "expo": "^43.0.0",
    "expo-analytics": "^1.0.16",
    "expo-analytics-amplitude": "~11.0.3",
    "expo-av": "~10.1.3",
    "expo-barcode-scanner": "~11.1.2",
    "expo-camera": "~12.0.3",
    "expo-clipboard": "~2.0.3",
    "expo-constants": "~12.1.3",
    "expo-crypto": "~10.0.3",
    "expo-dev-client": "~0.6.3",
    "expo-document-picker": "~10.0.3",
    "expo-file-system": "~13.0.3",
    "expo-font": "~10.0.3",
    "expo-image-picker": "~11.0.3",
    "expo-linear-gradient": "~10.0.3",
    "expo-linking": "~2.4.2",
    "expo-location": "~13.0.4",
    "expo-media-library": "~13.0.3",
    "expo-network": "~4.0.3",
    "expo-notifications": "~0.13.3",
    "expo-screen-capture": "^1.0.1",
    "expo-screen-orientation": "~4.0.3",
    "expo-secure-store": "~11.0.3",
    "expo-status-bar": "~1.1.0",
    "expo-store-review": "~5.0.3",
    "expo-tracking-transparency": "~2.0.3",
    "expo-updates": "~0.10.15",
    "lottie-react-native": "4.0.3",
    "moment": "^2.27.0",
    "numeral": "^2.0.6",
    "react": "17.0.1",
    "react-native": "0.64.3",
    "react-native-appearance": "~0.3.3",
    "react-native-base64": "0.0.2",
    "react-native-calendars": "^1.1275.0",
    "react-native-chart-kit": "^6.3.0",
    "react-native-cn-richtext-editor": "^1.0.40",
    "react-native-collapsible": "^1.5.3",
    "react-native-copilot": "^2.5.1",
    "react-native-crypto-js": "^1.0.0",
    "react-native-date-picker": "^4.1.3",
    "react-native-elements": "^3.4.2",
    "react-native-fetch-polyfill": "^1.1.3",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-hyperlink": "0.0.19",
    "react-native-image-slider-box": "^1.0.12",
    "react-native-image-viewing": "^0.2.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "0.28.1",
    "react-native-modal": "^11.5.6",
    "react-native-multiple-select": "^0.5.3",
    "react-native-otp-textinput": "0.0.5",
    "react-native-pager-view": "5.4.6",
    "react-native-pose": "^0.9.0",
    "react-native-progress": "^4.1.2",
    "react-native-qrcode-svg": "^5.2.0",
    "react-native-ratings": "^7.3.0",
    "react-native-reanimated": "~2.2.0",
    "react-native-render-html": "^4.2.2",
    "react-native-safe-area-context": "3.3.2",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-scalable-image": "^1.1.0",
    "react-native-screens": "~3.8.0",
    "react-native-scroll-into-view": "^1.0.3",
    "react-native-skeleton-content": "^1.0.22",
    "react-native-svg": "12.1.1",
    "react-native-swipe-list-view": "^3.2.3",
    "react-native-tab-view": "^3.1.1",
    "react-native-unimodules": "~0.15.0",
    "react-native-vector-icons": "^9.0.0",
    "react-native-webview": "11.13.0",
    "react-navigation": "^3.11.1",
    "react-navigation-drawer": "^2.5.0",
    "react-navigation-stack": "^2.8.2",
    "react-redux": "^5.1.1",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "rn-swipe-button": "^1.2.8",
    "url-parse": "^1.4.7"
  },
  "devDependencies": {
    "@expo/vector-icons": "^12.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^5.9.0",
    "eslint-plugin-react": "^7.20.4",
    "react-native-dotenv": "^0.2.0"
  }
}

I hope someone can gives an answer related to this issue
Thanks before!

what is the output of expo doctor in your project?

:tada: Didn’t find any issues with the project!

can you share a link to your build page?

Build Details — 3481d3b2-9d94-4d51-be08-a19b1b627fac — @kevinhobert/NDCMinistry — Expo

Is this the correct one?

I can reproduce this with your dependencies.

I also tried upgrading to Expo SDK 44 without luck (but the error was different and I didn’t try upgrading the packages that expo upgrade did not upgrade).

I then tried upgrading to Expo SDK 45 and also upgraded the dependencies that expo upgrade left alone. Unfortunately that still fails like this:

Build error
> Task :react-native-gradle-plugin:compileKotlin
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (155, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (161, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (169, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (100, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with rootto point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (28, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (132, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (252, 14): 'BaseVariant' is deprecated. Deprecated in Java
> Task :react-native-gradle-plugin:compileJava
[stderr] Note: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
[stderr] Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar
> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/@unimodules/core/android/build.gradle' line: 3
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':unimodules-core'.
[stderr] > Plugin with id 'maven' not found.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':expo'.
[stderr] > compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 30s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 executed
Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

But, this build log mentions the deprecated unimodules. I see you have these in your dependencies:

Those should not be there for a managed app.

You’re also missing @babel/core from your devDependencies. This is installed in a newly created Expo app. I’m not sure if it would work without that. It might be pulled in by something else :man_shrugging:
I see you have @expo/vector-icons in your devDependencies. I believe those should be in your dependencies instead.

Unfortunately it still doesn’t build with those changes. So I suspect some of your other dependencies are causing problems.

Maybe try starting with a newly created app and start adding dependencies that you need to it until the build starts failing. You could do this a chunk at a time instead of one library at a time. (Basically a binary/bisection search.) Once you figure out which dependency/dependencies are causing the problem it will be easier to figure out what to do about it.

When I don’t include those modules above, it produces error when building the app in Expo Go

Unable to resolve module @unimodules/react-native-adapter from C:\Users\KEVIN\Desktop\NDC-Apps\node_modules\@unimodules\core\build\AdapterProxy.js: @unimodules/react-native-adapter could not be found within the project or in these directories:
 node_modules
  ..\..\node_modules
> 1 | export * from '@unimodules/react-native-adapter';
    |                ^
  2 | //# sourceMappingURL=AdapterProxy.js.map

This is the result of building new project with Expo 45 using expo-init, and it produces new dependencies. Below is the content of package.json

{
  "name": "ndc-ministry",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.1.0",
    "@expo-google-fonts/judson": "^0.1.0",
    "@expo-google-fonts/montserrat": "^0.1.0",
    "@expo-google-fonts/noto-sans": "^0.1.0",
    "@expo-google-fonts/open-sans": "^0.1.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "8.2.0",
    "@react-native-community/slider": "4.2.1",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/drawer": "^6.1.8",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "dotenv": "^16.0.1",
    "expo": "~45.0.0",
    "expo-analytics": "^1.0.16",
    "expo-analytics-amplitude": "~11.2.0",
    "expo-av": "~11.2.3",
    "expo-barcode-scanner": "~11.3.0",
    "expo-camera": "~12.2.0",
    "expo-clipboard": "~3.0.1",
    "expo-constants": "~13.1.1",
    "expo-crypto": "~10.2.0",
    "expo-dev-client": "~0.9.6",
    "expo-document-picker": "~10.2.1",
    "expo-file-system": "~14.0.0",
    "expo-font": "~10.1.0",
    "expo-image-picker": "~13.1.1",
    "expo-linear-gradient": "~11.3.0",
    "expo-linking": "~3.1.0",
    "expo-location": "~14.2.2",
    "expo-media-library": "~14.1.0",
    "expo-network": "~4.2.0",
    "expo-notifications": "~0.15.2",
    "expo-screen-capture": "^1.0.1",
    "expo-screen-orientation": "~4.2.0",
    "expo-secure-store": "~11.2.0",
    "expo-status-bar": "~1.3.0",
    "expo-store-review": "~5.2.0",
    "expo-tracking-transparency": "~2.2.0",
    "expo-updates": "~0.13.2",
    "lottie-react-native": "5.0.1",
    "moment": "^2.27.0",
    "numeral": "^2.0.6",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-base64": "0.0.2",
    "react-native-calendars": "^1.1275.0",
    "react-native-chart-kit": "^6.3.0",
    "react-native-cn-richtext-editor": "^1.0.40",
    "react-native-collapsible": "^1.5.3",
    "react-native-copilot": "^2.5.1",
    "react-native-crypto-js": "^1.0.0",
    "react-native-date-picker": "^4.1.3",
    "react-native-elements": "^3.4.2",
    "react-native-fetch-polyfill": "^1.1.3",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-hyperlink": "0.0.19",
    "react-native-image-slider-box": "^1.0.12",
    "react-native-image-viewing": "^0.2.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "0.30.2",
    "react-native-modal": "^11.5.6",
    "react-native-multiple-select": "^0.5.3",
    "react-native-otp-textinput": "0.0.5",
    "react-native-pager-view": "5.4.15",
    "react-native-pose": "^0.9.0",
    "react-native-progress": "^4.1.2",
    "react-native-qrcode-svg": "^5.2.0",
    "react-native-ratings": "^7.3.0",
    "react-native-reanimated": "~2.8.0",
    "react-native-render-html": "^4.2.2",
    "react-native-safe-area-context": "4.2.4",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-scalable-image": "^1.1.0",
    "react-native-screens": "~3.11.1",
    "react-native-scroll-into-view": "^1.0.3",
    "react-native-skeleton-content": "^1.0.22",
    "react-native-svg": "12.3.0",
    "react-native-swipe-list-view": "^3.2.3",
    "react-native-tab-view": "^3.1.1",
    "react-native-unimodules": "~0.15.0",
    "react-native-vector-icons": "^9.0.0",
    "react-native-web": "0.17.7",
    "react-native-webview": "11.18.1",
    "react-navigation": "^3.11.1",
    "react-navigation-drawer": "^2.5.0",
    "react-navigation-stack": "^2.8.2",
    "react-redux": "^5.1.1",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "rn-swipe-button": "^1.2.8",
    "url-parse": "^1.4.7"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "babel-eslint": "^10.1.0",
    "eslint": "^5.9.0",
    "eslint-plugin-react": "^7.20.4",
    "react-native-dotenv": "^3.3.1"
  },
  "private": true
}

Tried to remove react-native-unimodules & react-native-reanimated and re-install node modules, but produces same error

Note: This is not “the solution”, but might be useful information.

It builds with the following dependencies:

diff --git package.json package.json
index af6188e..c8f6bb8 100644
--- package.json
+++ package.json
@@ -25,8 +25,6 @@
     "@react-navigation/material-top-tabs": "^6.0.6",
     "@react-navigation/native": "^6.0.6",
     "@react-navigation/stack": "^6.0.11",
-    "@unimodules/core": "~7.2.0",
-    "@unimodules/react-native-adapter": "~6.5.0",
     "buffer": "^6.0.3",
     "expo": "^43.0.0",
     "expo-analytics": "^1.0.16",
@@ -44,11 +42,8 @@
     "expo-image-picker": "~11.0.3",
     "expo-linear-gradient": "~10.0.3",
     "expo-linking": "~2.4.2",
-    "expo-location": "~13.0.4",
     "expo-media-library": "~13.0.3",
     "expo-network": "~4.0.3",
-    "expo-notifications": "~0.13.3",
-    "expo-screen-capture": "^1.0.1",
     "expo-screen-orientation": "~4.0.3",
     "expo-secure-store": "~11.0.3",
     "expo-status-bar": "~1.1.0",
@@ -96,7 +91,6 @@
     "react-native-svg": "12.1.1",
     "react-native-swipe-list-view": "^3.2.3",
     "react-native-tab-view": "^3.1.1",
-    "react-native-unimodules": "~0.15.0",
     "react-native-vector-icons": "^9.0.0",
     "react-native-webview": "11.13.0",
     "react-navigation": "^3.11.1",
@@ -109,6 +103,7 @@
     "url-parse": "^1.4.7"
   },
   "devDependencies": {
+    "@babel/core": "^7.12.9",
     "@expo/vector-icons": "^12.0.0",
     "babel-eslint": "^10.1.0",
     "eslint": "^5.9.0",

Here’s an updated set of dependencies that still builds. (I added back expo-location and expo-notifications. If I tried adding back expo-screen-capture the build failed.):

diff --git package.json package.json
--- package.json
+++ package.json
@@ -25,8 +25,6 @@
     "@react-navigation/material-top-tabs": "^6.0.6",
     "@react-navigation/native": "^6.0.6",
     "@react-navigation/stack": "^6.0.11",
-    "@unimodules/core": "~7.2.0",
-    "@unimodules/react-native-adapter": "~6.5.0",
     "buffer": "^6.0.3",
     "expo": "^43.0.0",
     "expo-analytics": "^1.0.16",
@@ -48,7 +46,6 @@
     "expo-media-library": "~13.0.3",
     "expo-network": "~4.0.3",
     "expo-notifications": "~0.13.3",
-    "expo-screen-capture": "^1.0.1",
     "expo-screen-orientation": "~4.0.3",
     "expo-secure-store": "~11.0.3",
     "expo-status-bar": "~1.1.0",
@@ -96,7 +93,6 @@
     "react-native-svg": "12.1.1",
     "react-native-swipe-list-view": "^3.2.3",
     "react-native-tab-view": "^3.1.1",
-    "react-native-unimodules": "~0.15.0",
     "react-native-vector-icons": "^9.0.0",
     "react-native-webview": "11.13.0",
     "react-navigation": "^3.11.1",
@@ -109,6 +105,7 @@
     "url-parse": "^1.4.7"
   },
   "devDependencies": {
+    "@babel/core": "^7.12.9",
     "@expo/vector-icons": "^12.0.0",
     "babel-eslint": "^10.1.0",
     "eslint": "^5.9.0",

EDIT: I originally wrote expo-screen-saver instead of expo-screen-capture a few times below:

OK, I’ve figured it out with some help from @kbrandwijk and he’ll get it fixed.

Basically, there’s an endpoint used by expo doctor, expo install and expo upgrade to decide what versions of expo packages are compatible with which Expo SDK version and it was missing information about expo-screen-capture. For this reason none of those would have complained about version 1.x.y that you had installed, despite it being incompatible with Expo SDK version 43. Also, if you try to upgrade it with expo install expo-screen-capture then it installs the latest version which is too new for Expo SDK 43!

So until the endpoint is updated to include expo-screen-capture, you can manually install the correct version as follows:

yarn add expo-screen-capture@4.0.1

or

npm install expo-screen-capture@4.0.1

You will also need to remove the three unimodules dependencies I mentioned previously and I think you should also install @babel/core@^7.12.9 as a devDependency.

Then it should build.

EDIT: This has been fixed. Thanks, Kim :slight_smile:

Now if you run expo doctor it should say something like this:

$ expo doctor
Some dependencies are incompatible with the installed expo package version:
 - expo-screen-capture - expected version: ~4.0.1 - actual version installed: 1.1.1
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]

It currently does not complain about the unimodules dependencies, but apparently that is being worked on.

So to allow your app to build, do this:

$ yarn remove @unimodules/core @unimodules/react-native-adapter react-native-unimodules
$ yarn add -D @babel/core@^7.12.9
$ expo doctor --fix-dependencies

(Or use npm instead of yarn if that’s what you have been using to manage your dependencies)

1 Like

It works nicely. But maybe you got a typo on the package name. It should be expo-screen-capture, not expo-screen-saver. Once again, thank you very much for the answer. I hope this community is filled with an awesome person such as you and your team :slight_smile:

Indeed, I do. Sorry :slight_smile: I’ve fixed them now.

Thanks! But to be clear, I am just an Expo user. I do not work for them :slight_smile:

3 Likes

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