Adding cache.key to eas.json after SDK41 migration

I’ve recently migrating to SDK41 for a managed workflow app.

I’m trying to run my first EAS Build and bumped into this error within :Install pods" section:

Versions in the Podfile.lock cached by EAS do not match required values for some of the libraries, it can be triggered when upgrading Expo SDK or any other library with native code. To fix that update value of "cache.key" field in the eas.json to invalidate the cache.

I’ve modified my eas.json as follows:

{
  "cli": {
    "version": ">= 0.35.0"
  },
  "build": {    
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "cache": {
        "disabled": true
      }
    },
    "preview": {
      "distribution": "internal",
      "cache": {        
        "disabled": true
      }
    },    
    "production": {      
      "cache": {
        "disabled": true
      }
    }
  },
  "submit": {
    "production": {}
  }
}

Still facing the same problem.

Hey @maxaquilino, in your code snippet you provided it looks as if you haven’t modified cache.key. Doing so would look like this:

"cache": {
  "key": "insert-new-string-value-here"
}

Can you try making said change and see if it bears any results?

Cheers,
Adam

Hi @adamjnav

Thanks for the reply, I’ve actually starting using the syntax you have suggested in other projects.

Some times that solves the issues if it is related to cache problems, other times as the error message suggest can be related to conflict of dependencies.

As matter of curiosity, my understanding is that the cache issue should be now solved by PR341 as stated by @charliecruzan here Expo SDK 41 EAS build failing - #7 by charliecruzan

Cheers

I’ve recently migrating to SDK41 for a managed workflow app.

I checked last failed build on your account that finished with the error you posted and they are all bare projects. In bare project Podfile.lock is cached only if it does not exists in the repo, otherwise lockfile from repo is used

btw if you need to just one time clear cache e.g. after switching sdk I recommend running eas build --clear-cache.

@wkozyra All my projects are managed, meaning that I’ve never ejected. I guess that running eas build would make it from “managed” to “bare”.

I find it a bit ambiguous the message recommending to clear the cache even if the cache has already been cleared by previous attempts

if you have android and ios directory then project is bare, it can happen if you run expo eject or expo prebuild or expo run:ios(or android). You can see in your build logs that there is no prebuild phase there.

If you want to have manged project and use expo prebuild or run:ios, run:android you need to add android and ios directories to gitignore(and remove them from git if it’s already comitted)

You’re absolutely right, I can see those directories now for the first time. I didn’t eject but did run expo prebuild as you pointed out.

I’ve added those folders to .gitignore

node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
android/
ios/

I haven’t committed anything as the eas build keeps failing.

Shall I just delete those directories (android, ios, .gitignore) from my project if I want to go back to managed?

it’s probably best to delete android and ios directories to make sure there is nothing staged in git, but I recommend leaving .gitignore just in case

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