setup-android icon indicating copy to clipboard operation
setup-android copied to clipboard

SDK location not found

Open lukasz-kalnik-gcx opened this issue 3 years ago • 3 comments

I'm using https://github.com/nektos/act and Docker Desktop for Mac to run GitHub Actions locally. I added the [email protected] action to my workflow. It installs the Android SDK and accepts the licenses, however then the build fails with the exception:

> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '(...)local.properties'.

lukasz-kalnik-gcx avatar Oct 26 '22 11:10 lukasz-kalnik-gcx

Ok, I worked around this by manually setting the environment variable in an .env file like this:

ANDROID_HOME=/root/.android/sdk

Then I passed the .env file to act runner like this:

act --env-file .env

However, it would be a really nice improvement if the setup-android action would set the ANDROID_HOME environment variable automatically.

lukasz-kalnik-gcx avatar Oct 26 '22 12:10 lukasz-kalnik-gcx

Hello Lukasz,

We do actually export the ANDROID_HOME env var.

main.ts:

core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)

Could it be that act isn't picking it up somewhy?

ViliusSutkus89 avatar Sep 25 '23 02:09 ViliusSutkus89

Could it be that the installation did not complete fully? e.g. due to https://github.com/android-actions/setup-android/issues/283. Are you sure that the first error in the logs, @lukasz-kalnik-gcx?

I had some partial success with echo '--container-architecture linux/amd64' >> .actrc, see warning.

TWiStErRob avatar Nov 21 '23 21:11 TWiStErRob