Skip to content

Fix android/osx job on ci - Error: reserveCache failed: Cache already exists. #116

@ortex

Description

@ortex

Sometimes we have problem with Install Android SDK components step on CI.

      - name: Install Android SDK components
        uses: maxim-lobanov/setup-android-tools@v1
        with:
          cache: true
          packages: |
            platforms;android-${{ matrix.api }}
            build-tools;${{ matrix.build_tools }}
            ndk;${{ matrix.ndk }}
            cmake;${{ matrix.cmake }}
            system-images;android-${{ matrix.api }};${{ matrix.avd_image }};${{ matrix.avd_arch }}
            emulator

e.g. https://github.com/roc-streaming/roc-java/actions/runs/5083653562 :

Run maxim-lobanov/setup-android-tools@v1
Getting list of available components

Installing 'platforms;android-29'...
  Package is already installed and update is not required

Installing 'build-tools;28.0.3'...
  Package is already installed and update is not required

Installing 'ndk;[21](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:23).1.635[24](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:26)62'...
Trying to restore package from cache...
  Package is restored from cache

Installing 'cmake;3.10.2.4988404'...
Trying to restore package from cache...
  Package is restored from cache

Installing 'system-images;android-29;default;x86_64'...
Trying to restore package from cache...
  Package is restored from cache

Installing 'emulator'...
  Package is already installed but update is required
Trying to restore package from cache...
  No cache found
Trying to download package via sdkmanager...
  Package is downloaded and installed
Saving package to cache...
  Error: reserveCache failed: Cache already exists. Scope: refs/pull/115/merge, Key: emulator/32.1.13/macos12, Version: a9f019e19b66fa[27](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:29)731f9a30544c8c38d8e005fcc1[59](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:63)c97da1[75](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:80)fea90accf[79](https://github.com/roc-streaming/roc-java/actions/runs/5083653562/jobs/9144799554#step:3:84)1

I suppose that because we have 2 similar job that saves to cache the same thing

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions