'Expo EAS build failing when compiling Expo (Expo Managed app)

I'm trying to compile my React Native app built using Expo (Expo managed workflow), and it keeps failing with this error

> Task :expo-application:compileReleaseKotlin FAILED
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (15, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (16, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (17, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (18, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (19, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (20, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (27, 58): Unresolved reference: ExportedModule
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (27, 84): Unresolved reference: RegistryLifecycleListener
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (28, 32): Unresolved reference: ModuleRegistry
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (29, 34): Unresolved reference: ActivityProvider
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (32, 3): 'getName' overrides nothing
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (36, 3): 'onCreate' overrides nothing
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (36, 41): Unresolved reference: ModuleRegistry
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (38, 50): Unresolved reference: ActivityProvider
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (42, 3): 'getConstants' overrides nothing
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (65, 4): Unresolved reference: ExpoMethod
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (66, 41): Unresolved reference: Promise
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (78, 4): Unresolved reference: ExpoMethod
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (79, 39): Unresolved reference: Promise
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (91, 4): Unresolved reference: ExpoMethod
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.kt: (92, 40): Unresolved reference: Promise
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (4, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (5, 21): Unresolved reference: core
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (7, 28): Unresolved reference: BasePackage
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (8, 3): 'createExportedModules' overrides nothing
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (8, 62): Unresolved reference: ExportedModule
[stderr] e: /root/workingdir/build/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationPackage.kt: (9, 49): Unresolved reference: ExportedModule
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-application:compileReleaseKotlin'.
[stderr] > Compilation error. See log for more details
[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 3m 44s
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
204 actionable tasks: 204 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

My package.json:

{
  "name": "igas",
  "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/poppins": "^0.1.0",
    "@react-native-async-storage/async-storage": "^1.15.14",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^7.1.7",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "axios": "^0.24.0",
    "expo": "^44.0.0",
    "expo-app-loading": "^1.3.0",
    "expo-camera": "^12.1.0",
    "expo-splash-screen": "^0.14.1",
    "expo-status-bar": "^1.2.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "^0.66.4",
    "react-native-dropdown-picker": "^5.2.3",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-reanimated": "^2.3.1",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-scroll-lazy": "^1.0.1",
    "react-native-side-menu-updated": "^1.3.2",
    "react-native-tab-view": "^2.15.2",
    "react-native-unimodules": "^0.14.10",
    "react-native-vector-icons": "^8.0.0",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2",
    "redux-thunk": "^2.4.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

Tried updating all packages (project was previously on Expo SDK 42, updated to SDK 44). When running expo upgrade some packages didn't update, so I had to do it by hand.



Solution 1:[1]

Make sure to check

Custom "main" entry point in package.json is not yet supported

From this article

https://docs.expo.dev/build-reference/migrating/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Widjesh Shiva Bhaggan