EAS android build `:expo-file-system:compileReleaseKotlin`

I’m seeing this error building android, ios build is working fine with the same code. I haven’t been able to find a similar issue or thread anywhere referencing an issue with :expo-file-system:compileReleaseKotlin.

Edit: error is from :expo-file-system:compileReleaseKotlin says Unresolved reference: AppContextLost

[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-file-system:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr] > Compilation error. See log for more details
[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] java.lang.StackOverflowError (no error message)
[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 9m 8s

To boot, nowhere in my package.json is expo-file-system defined.

adding expo-file-system to my app seemed to fix, hasn’t happened in the past but oh well :man_shrugging:

it sounds like you may have a library in your app that is depending on an old version of expo-file-system. can you try running npm why expo-file-system and sharing the output?

Looks like quite a few packages do, but unsure why I never had this issue in the past with builds that used these packages

node_modules/expo-file-system
  expo-file-system@"~15.2.2" from the root project
  expo-file-system@"~15.2.2" from expo@48.0.20
  node_modules/expo
    expo@"~48.0.18" from the root project
    peer expo@"*" from expo-constants@14.2.1
    node_modules/expo-constants
      expo-constants@"~14.2.1" from the root project
      expo-constants@"~14.2.1" from expo@48.0.20
      expo-constants@"~14.2.0" from expo-notifications@0.18.1
      node_modules/expo-notifications
        expo-notifications@"~0.18.1" from the root project
      expo-constants@"~14.2.0" from expo-linking@4.0.1
      node_modules/expo-linking
        expo-linking@"~4.0.1" from the root project
    peer expo@"*" from expo-apple-authentication@6.0.1
    node_modules/expo-apple-authentication
      expo-apple-authentication@"~6.0.1" from the root project
    peer expo@"*" from expo-dev-menu@2.2.0
    node_modules/expo-dev-menu
      expo-dev-menu@"2.2.0" from expo-dev-launcher@2.2.1
      node_modules/expo-dev-launcher
        expo-dev-launcher@"2.2.1" from expo-dev-client@2.2.1
        node_modules/expo-dev-client
          expo-dev-client@"~2.2.1" from the root project
      expo-dev-menu@"2.2.0" from expo-dev-client@2.2.1
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from expo-dev-launcher@2.2.1
    node_modules/expo-dev-launcher
      expo-dev-launcher@"2.2.1" from expo-dev-client@2.2.1
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from expo-blur@12.2.2
    node_modules/expo-blur
      expo-blur@"~12.2.2" from the root project
    peer expo@"*" from expo-dev-menu-interface@1.1.1
    node_modules/expo-dev-menu-interface
      expo-dev-menu-interface@"1.1.1" from expo-dev-menu@2.2.0
      node_modules/expo-dev-menu
        expo-dev-menu@"2.2.0" from expo-dev-launcher@2.2.1
        node_modules/expo-dev-launcher
          expo-dev-launcher@"2.2.1" from expo-dev-client@2.2.1
          node_modules/expo-dev-client
            expo-dev-client@"~2.2.1" from the root project
        expo-dev-menu@"2.2.0" from expo-dev-client@2.2.1
        node_modules/expo-dev-client
          expo-dev-client@"~2.2.1" from the root project
      expo-dev-menu-interface@"1.1.1" from expo-dev-client@2.2.1
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from expo-device@5.2.1
    node_modules/expo-device
      expo-device@"~5.2.1" from the root project
    peer expo@"*" from expo-font@11.1.1
    node_modules/expo-font
      expo-font@"~11.1.1" from the root project
      expo-font@"~11.1.1" from expo@48.0.20
    peer expo@"*" from expo-keep-awake@12.0.1
    node_modules/expo-keep-awake
      expo-keep-awake@"~12.0.1" from expo@48.0.20
    peer expo@"*" from expo-file-system@15.2.2
    peer expo@"*" from expo-dev-client@2.2.1
    node_modules/expo-dev-client
      expo-dev-client@"~2.2.1" from the root project
    peer expo@"*" from expo-linear-gradient@12.1.2
    node_modules/expo-linear-gradient
      expo-linear-gradient@"~12.1.2" from the root project
    peer expo@"*" from expo-notifications@0.18.1
    node_modules/expo-notifications
      expo-notifications@"~0.18.1" from the root project
    peer expo@"*" from expo-application@5.1.1
    node_modules/expo-application
      expo-application@"~5.1.1" from expo@48.0.20
      expo-application@"~5.1.0" from expo-notifications@0.18.1
      node_modules/expo-notifications
        expo-notifications@"~0.18.1" from the root project
    peer expo@"*" from expo-splash-screen@0.18.2
    node_modules/expo-splash-screen
      expo-splash-screen@"~0.18.2" from the root project
    peer expo@"*" from expo-localization@14.1.1
    node_modules/expo-localization
      expo-localization@"~14.1.1" from the root project
    peer expo@"*" from expo-updates@0.16.4
    node_modules/expo-updates
      expo-updates@"~0.16.4" from the root project
    peer expo@"*" from expo-web-browser@12.1.1
    node_modules/expo-web-browser
      expo-web-browser@"~12.1.1" from the root project
    peer expo@"*" from expo-updates-interface@0.9.3
    node_modules/expo-updates-interface
      expo-updates-interface@"~0.9.0" from expo-dev-client@2.2.1
      node_modules/expo-dev-client
        expo-dev-client@"~2.2.1" from the root project
      expo-updates-interface@"~0.9.0" from expo-updates@0.16.4
      node_modules/expo-updates
        expo-updates@"~0.16.4" from the root project
    peer expo@"*" from expo-splash-screen@0.17.5
    node_modules/expo-app-loading/node_modules/expo-splash-screen
      expo-splash-screen@"~0.17.0" from expo-app-loading@2.1.1
      node_modules/expo-app-loading
        expo-app-loading@"~2.1.0" from the root project
    peer expo@"*" from expo-file-system@15.4.3 dev
    node_modules/expo-asset/node_modules/expo-file-system
      expo-file-system@"~15.4.0" from expo-asset@8.10.1
      node_modules/expo-asset
        expo-asset@"~8.10.1" from expo@49.0.8
        node_modules/@types/expo/node_modules/expo
          expo@"*" from @types/expo@33.0.1
          node_modules/@types/expo
            dev @types/expo@"^33.0.1" from the root project
          peer expo@"*" from expo-constants@14.4.2
          node_modules/@types/expo/node_modules/expo-constants
            expo-constants@"~14.4.2" from expo@49.0.8
          peer expo@"*" from expo-file-system@15.4.3 dev
          node_modules/@types/expo/node_modules/expo-file-system
            expo-file-system@"~15.4.3" from expo@49.0.8
          peer expo@"*" from expo-application@5.3.1
          node_modules/@types/expo/node_modules/expo-application
            expo-application@"~5.3.0" from expo@49.0.8
          peer expo@"*" from expo-font@11.4.0
          node_modules/@types/expo/node_modules/expo-font
            expo-font@"~11.4.0" from expo@49.0.8
          peer expo@"*" from expo-keep-awake@12.3.0
          node_modules/@types/expo/node_modules/expo-keep-awake
            expo-keep-awake@"~12.3.0" from expo@49.0.8
    peer expo@"*" from expo-constants@14.4.2
    node_modules/expo-asset/node_modules/expo-constants
      expo-constants@"~14.4.2" from expo-asset@8.10.1
      node_modules/expo-asset
        expo-asset@"~8.10.1" from expo@49.0.8
        node_modules/@types/expo/node_modules/expo
          expo@"*" from @types/expo@33.0.1
          node_modules/@types/expo
            dev @types/expo@"^33.0.1" from the root project
          peer expo@"*" from expo-constants@14.4.2
          node_modules/@types/expo/node_modules/expo-constants
            expo-constants@"~14.4.2" from expo@49.0.8
          peer expo@"*" from expo-file-system@15.4.3 dev
          node_modules/@types/expo/node_modules/expo-file-system
            expo-file-system@"~15.4.3" from expo@49.0.8
          peer expo@"*" from expo-application@5.3.1
          node_modules/@types/expo/node_modules/expo-application
            expo-application@"~5.3.0" from expo@49.0.8
          peer expo@"*" from expo-font@11.4.0
          node_modules/@types/expo/node_modules/expo-font
            expo-font@"~11.4.0" from expo@49.0.8
          peer expo@"*" from expo-keep-awake@12.3.0
          node_modules/@types/expo/node_modules/expo-keep-awake
            expo-keep-awake@"~12.3.0" from expo@49.0.8
    peer expo@"*" from expo-constants@14.3.0
    node_modules/expo/node_modules/expo-asset/node_modules/expo-constants
      expo-constants@"~14.3.0" from expo-asset@8.9.2
      node_modules/expo/node_modules/expo-asset
        expo-asset@"~8.9.1" from expo@48.0.20
    peer expo@"*" from expo-file-system@15.3.0
    node_modules/expo/node_modules/expo-asset/node_modules/expo-file-system
      expo-file-system@"~15.3.0" from expo-asset@8.9.2
      node_modules/expo/node_modules/expo-asset
        expo-asset@"~8.9.1" from expo@48.0.20

expo-file-system@15.4.3 dev
node_modules/expo-asset/node_modules/expo-file-system
  expo-file-system@"~15.4.0" from expo-asset@8.10.1
  node_modules/expo-asset
    expo-asset@"~8.10.1" from expo@49.0.8
    node_modules/@types/expo/node_modules/expo
      expo@"*" from @types/expo@33.0.1
      node_modules/@types/expo
        dev @types/expo@"^33.0.1" from the root project
      peer expo@"*" from expo-constants@14.4.2
      node_modules/@types/expo/node_modules/expo-constants
        expo-constants@"~14.4.2" from expo@49.0.8
      peer expo@"*" from expo-file-system@15.4.3 dev
      node_modules/@types/expo/node_modules/expo-file-system
        expo-file-system@"~15.4.3" from expo@49.0.8
      peer expo@"*" from expo-application@5.3.1
      node_modules/@types/expo/node_modules/expo-application
        expo-application@"~5.3.0" from expo@49.0.8
      peer expo@"*" from expo-font@11.4.0
      node_modules/@types/expo/node_modules/expo-font
        expo-font@"~11.4.0" from expo@49.0.8
      peer expo@"*" from expo-keep-awake@12.3.0
      node_modules/@types/expo/node_modules/expo-keep-awake
        expo-keep-awake@"~12.3.0" from expo@49.0.8

expo-file-system@15.4.3 dev
node_modules/@types/expo/node_modules/expo-file-system
  expo-file-system@"~15.4.3" from expo@49.0.8

expo-file-system@15.3.0
node_modules/expo/node_modules/expo-asset/node_modules/expo-file-system
  expo-file-system@"~15.3.0" from expo-asset@8.9.2
  node_modules/expo/node_modules/expo-asset
    expo-asset@"~8.9.1" from expo@48.0.20
node_modules/expo-file-system
  expo-file-system@"~15.2.2" from the root project
  expo-file-system@"~15.2.2" from expo@48.0.20
  node_modules/expo
    expo@"~48.0.18" from the root project
...etc

expo-file-system@15.4.3 dev
node_modules/@types/expo/node_modules/expo-file-system
  expo-file-system@"~15.4.3" from expo@49.0.8

expo-file-system@15.3.0
node_modules/expo/node_modules/expo-asset/node_modules/expo-file-system
  expo-file-system@"~15.3.0" from expo-asset@8.9.2
  node_modules/expo/node_modules/expo-asset
    expo-asset@"~8.9.1" from expo@48.0.20

you can see here that there are three distinct versions of expo-file-system being installed. the recommended version for sdk 48 “~15.2.2” - this is what you will get if you run npx expo install expo-file-system in your project. it looks like you also have both expo@48 and expo@49 installed. run npx expo-doctor and share the results

1 Like

so, looking at this again - it appears the problem is that you have the @types/expo package installed. it expresses a dependency on expo as follows:

this is … not correct. "*" is pulling in the latest version of the expo package. so we should follow up with that repository. you can uninstall the @types/expo package, it’s not needed. we include types in the expo package itself.

1 Like

Ah, I think that makes more sense now, just started migrating to TS with the code this failed with