docker-android-sdk / android-30 Goto Github PK
View Code? Open in Web Editor NEWDocker for Android SDK 30 with preinstalled build tools and emulator image
Docker for Android SDK 30 with preinstalled build tools and emulator image
For ndk included project, wait for ndk download is really painful.
Is there documentation on how to use this image in detail?
e.g. I had to run apt-get install pulseaudio
and libxcursor-dev
to get the emulator to pop up a screen, but even then audio didn't work... I'm wondering if that is what this is for?
Should I be using the image to 'run a phone on my screen' or in some more technical way?
I can post a log of errors if that helps. e.g., one among several:
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
WARNING | cannot add library /opt/android-sdk-linux/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
Thank you for this image, it's a lot of fun to play with (crashes quite a bit though).
Cheers,
Dan.
Hello,
Copied apk from local to Docker container.
C:\WINDOWS\system32>docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2e5c65bc2f32 androidsdk/android-30:latest "bash" 12 seconds ago Up 6 seconds intelligent_rubin
C:\WINDOWS\system32>docker cp C:\sample_apks\Calculator_base.apk intelligent_rubin:/home
For installation of apk in docker used below command.
root@2e5c65bc2f32:/opt/android-sdk-linux# adb devices
List of devices attached
emulator-5554 device
root@2e5c65bc2f32:/opt/android-sdk-linux# adb install -r /home/Calculator_base.apk
Performing Streamed Install
adb: failed to install /home/Calculator_base.apk: cmd: Can't find service: package
Even I have checked that /home is having respective apk.
root@2e5c65bc2f32:/opt/android-sdk-linux# cd /home
root@2e5c65bc2f32:/home# ls
Calculator_base.apk
Can you please help me why above error occurred? cmd: Can't find service: package
I'm trying to access the emulator container via adb using another container but can't find a way to connect, no devices are available.
The only way it works is using "--network host" and connecting using adb from the host.
If I try to use a bridge network and try to access the emulator from anther container, I get connection refused: even publishing the ports like "-p 5555:5555" and "-p 5554:5554" and trying from the host I can't connect.
I tried "adb connect ip-addr:555x" but still nothing.
How can I solve this ?
Should I publish more ports to try from localhost ?
the image is ubuntu18.04, Will there be a version available that supports ARM CPU?
Apple arm notebook need a new version
I team, i am using this image for my Gitlab CI. But my company sysdig scan has found the major and medium issues in below frameworks,
1.log4j, 2. protobuf, 3.guava - fix is 23.6.1 24.1.1 25.0, 4. commons-compress, 5.commns-codec.
Is it possible to fix this sysdig scan issues?
While executing command - emulator -avd first_avd -no-window -no-audio &
Below error occcured.
root@d23fca28e0be:/opt/android-sdk-linux# emulator -avd first_avd -no-window -no-audio &
[1] 113
root@d23fca28e0be:/opt/android-sdk-linux# emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
WARNING. Using fallback path for the emulator registration directory.
Your emulator is out of date, please update by launching Android Studio:
root@d23fca28e0be:/opt/android-sdk-linux# adb devices
Can you please help, how to resolve this error?
Your emulator is out of date, please update by launching Android Studio:
-> Do I need to open Android Studio (which I am using previously) which is installed on my laptop (Windows 10) out side Docker.
Please update to support SDK level 34
I am attempting to use a Bitbucket Pipeline to build and test android apps. The Bitbucket Pipeline contains three steps
While creating the emulator in the instrumentation tests I am getting the following error:
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: KVM requires a CPU that supports vmx or svm
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
The code for Bitbucket Pipeline is in bitbucket-pipelines.yml
# Bitbucket Pipelines Template to build, test your Android Application.
# This template contains 3 parallel steps to build Android application, run Android code scanning tool and run unit tests.
# For more details see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
# Docker for Android SDK 30 with pre-installed build tools and emulator image.
# Note: This docker image is created and maintained by a non official third party. For more details see: https://hub.docker.com/r/androidsdk/android-30
image: androidsdk/android-30
definitions:
caches:
gradle-wrapper: ~/.gradle/wrapper
android-emulator: $ANDROID_HOME/system-images/android-30
pipelines:
pull-requests:
'**': #this runs as default for any branch not elsewhere defined
- step: # step to run lint (Android code scanning tool)
name: Lint Check
caches: # caching speed up subsequent execution https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/
- gradle
- gradle-wrapper
script:
- ./gradlew ktlintCheck
artifacts:
- app/build/reports/** # artifacts are files that are produced by a step https://support.atlassian.com/bitbucket-cloud/docs/use-artifacts-in-steps/
- parallel:
- step: # step to run unit tests
name: Unit Tests
script:
- ./gradlew testDebugUnitTest # test reporting is automatically enabled https://support.atlassian.com/bitbucket-cloud/docs/test-reporting-in-pipelines/
artifacts:
- app/build/reports/**
- step:
name: Instrumentation Tests
script:
- ./instrumentation-tests.sh
artifacts:
- app/build/reports/**
The script for instrumentation test is in file instrumentation-tests.sh
#!/bin/bash
# Arm emulators can be quite slow. For this reason it is convenient
# to increase the adb timeout to avoid errors.
export ADB_INSTALL_TIMEOUT=30
# Create an ARM AVD emulator, with a 100 MB SD card storage space. Echo "no"
# because it will ask if you want to use a custom hardware profile, and you don't.
# https://medium.com/@AndreSand/android-emulator-on-docker-container-f20c49b129ef
echo "no" | avdmanager create avd \
-n Android_R_API_30 \
--abi google_apis/x86_64 \
-k "system-images;android-30;google_apis;x86_64" \
-c 100M \
--force
# Launch the emulator in the background
$ANDROID_HOME/emulator/emulator -avd Android_R_API_30 -no-audio -no-window -no-boot-anim -gpu off -wipe-data &
EMULATOR_PID=$!
# Run the tests
./gradlew connectedDebugAndroidTest -i
# Stop the background processes
kill $EMULATOR_PID
# Note: You will have to add a suitable time delay, to wait for the emulator to launch.
The issue related to
https://confluence.atlassian.com/bitbucketserverkb/accented-or-extended-utf-8-characters-cause-malformed-input-or-input-contains-unmappable-characters-error-966062671.html
On Bitbucket pipeline some Gradle builds could crash with message:
Malformed input or input contains unmappable characters: #class path#
The image locale returns
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
My issue is with Cucumber library. Exactly same as reported there:
cucumber/cucumber-android#41
Fixed by set export LANG="en_US.UTF-8"
and run
apt-get clean && apt-get update -qq && apt-get install -qq -y apt-utils locales
locale-gen $LANG
before Gradle build run. But nice to see it as image default locale.
Having build issues with the app and unsure why it's not working on BitBucket Pipelines. Works fine on the Windows 10 machine & internal Jenkins CI server. The repo has nested submodules.
Edit: After looking at it it looks like there's an issue with BitBucket so will report it to them.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:testUkAllinoneAdsWithIapReleaseUnitTest'.
> Could not resolve all task dependencies for configuration ':app:ukAllinoneAdsWithIapReleaseUnitTestRuntimeClasspath'.
> Could not resolve project :lib:mediaServer.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:mediaServer was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:poppy.
Required by:
project :app
> No matching configuration of project :lib:poppy was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:mathete-voiceover-player.
Required by:
project :app
> No matching configuration of project :lib:mathete-voiceover-player was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:parsnip.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:parsnip was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:mathete-book-position-persister.
Required by:
project :app
> No matching configuration of project :lib:mathete-book-position-persister was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:learn2registration.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:learn2registration was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-onboarding:lib.
Required by:
project :app
> No matching configuration of project :lib:imagitech-onboarding:lib was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-licensing:licensing-core.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-licensing:licensing-core was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-licensing:licensing-dialog.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-licensing:licensing-dialog was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-searchable-documents:searchable-documents-core.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-searchable-documents:searchable-documents-core was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:android-sqlite-asset-helper:library.
Required by:
project :app
> No matching configuration of project :lib:android-sqlite-asset-helper:library was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-searchable-documents:highway-code.
Required by:
project :app
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-searchable-documents:highway-code was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-telemetry:core.
Required by:
project :app > project :core
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-telemetry:core was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-telemetry:api-firebase.
Required by:
project :app > project :core
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-telemetry:api-firebase was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-library.
Required by:
project :app > project :core
project :app > project :lib:mathete
project :app > project :hazard-perception
> No matching configuration of project :lib:imagitech-library was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:mathete-question.
Required by:
project :app > project :lib:mathete
> No matching configuration of project :lib:mathete-question was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
> Could not resolve project :lib:imagitech-onboarding:viewPagerIndicator.
Required by:
project :app > project :hazard-perception
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
> No matching configuration of project :lib:imagitech-onboarding:viewPagerIndicator was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'monetisation' with value 'adsWithIap', attribute 'testType' with value 'ukAllinone', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 52s
On Docker: Not able to launch emulator got error - CPU acceleration status: KVM requires a CPU that supports vmx or svm
Available Updates:
ID | Installed | Available |
---|---|---|
cmdline-tools;latest | 2.1 | 4.0 |
emulator | 30.1.5 | 30.6.5 |
platform-tools | 30.0.4 | 31.0.2 |
system-images;android-30;google_apis;x86_64 | 8 | 10 |
root@547e0a3576ac:/opt/android-sdk-linux# avdmanager create avd -n first_avd --abi google_apis/x86_64 -k "system-images;android-30;google_apis;x86_64"
Do you wish to create a custom hardware profile? [no] emote repository...
root@547e0a3576ac:/opt/android-sdk-linux# emulator -avd first_avd -no-window -no-audio &
[1] 113
root@547e0a3576ac:/opt/android-sdk-linux# emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: KVM requires a CPU that supports vmx or svm
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
Windows 10
Even BIOS is enabled...still error is there.
Can you help me, how to run emulator on Docker?
Note: I went through few websites...which tells-
Emulator
ARM emulator is host machine independent, can run anywhere - Linux, macOS, VM and etc. While the performance is a bit poor. On the contrary, x86 emulator requires KVM, which means only runnable on Linux.
According to Google's documentation:
VM acceleration restrictions
Note the following restrictions of VM acceleration:
You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMWare, or Docker. You must run the emulator directly on your system hardware.
You can't run software that uses another virtualization technology at the same time that you run the accelerated emulator. For example, VirtualBox, VMWare, and Docker currently use a different virtualization technology, so you can't run them at the same time as the accelerated emulator.
Hi, Is there a plan to create a repo for android-31 as well? Thank you
Was just curious if this only works directly on Linux, or if you happened to know of ways to get it working on containers running on top of Docker for Mac/WSL 2 as well (for local testing)
TL;DR
I just tried it on a Mac and ran into a warning when starting the emulator that "kvm" was missing and that hardware acceleration was required. AFAICT from a flurry of google searching OSX doesn't support kvm for virtualization, so I ended up concluding it might not be possible.
I'm in the process of trying it out on WSL 2 but I'm not optimistic about my chances there either given this outstanding issue around nested virtualization.
Is the only alternative to spin up Linux VMs and run Docker there instead? If not, would love to hear about what folks have done to make it work directly.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.