softartdev / docker-android-fastlane

Docker image with AndroidSDK & Fastlane
MIT License
22 stars 21 forks source link

Can't create Android-Emulator #6

Closed Sayum24 closed 1 month ago

Sayum24 commented 1 month ago

I wanted to create an AVD (Android Virtual Device) using the Android SDK's avdmanager.

The command I used to create an avd:

avdmanager create avd --force --name Medium_Phone_API_31 --abi x86 --tag google_apis_playstore --package 'system-images;android-27;google_apis_playstore;x86'

Error:

Warning: Observed package id 'build-tools;34.0.0' in inconsistent location '/usr/local/android-sdk-linux/build-tools/34.0.0' (Expected '/usr/local/build-tools/34.0.0')
Warning: Observed package id 'extras;android;m2repository' in inconsistent location '/usr/local/android-sdk-linux/extras/android/m2repository' (Expected '/usr/local/extras/android/m2repository')
Warning: Observed package id 'extras;google;m2repository' in inconsistent location '/usr/local/android-sdk-linux/extras/google/m2repository' (Expected '/usr/local/extras/google/m2repository')
Warning: Observed package id 'platform-tools' in inconsistent location '/usr/local/android-sdk-linux/platform-tools' (Expected '/usr/local/platform-tools')
Warning: Observed package id 'platforms;android-34' in inconsistent location '/usr/local/android-sdk-linux/platforms/android-34' (Expected '/usr/local/platforms/android-34')
[=======================================] 100% Fetch remote repository...       
Error: Package path is not valid. Valid system image paths are:
null
Sayum24 commented 1 month ago

Could be connected to this: https://stackoverflow.com/questions/65262340/cmdline-tools-could-not-determine-sdk-root

softartdev commented 1 month ago

The image does not have an Android emulator. You should use some other image that has an Android emulator for ui tests or other use.

Sayum24 commented 1 month ago

Thanks for the heads up. I found a solution for this error.

I had to change the folder structure described in these SO-Answers:

softartdev commented 1 month ago

Maybe I misunderstood your question. Sure, you can create an emulator inside a container. Remember, you'll need to create emulators inside each container again. It would be more efficient to create an emulator inside a docker image, each container will already have an emulator built in.

Sayum24 commented 1 month ago

I wanted to create with the creation of the container an Emulator inside the Docker.