Gradle not able to download andriod packages

I have a docker container with Andriod SDK on it. I am trying to build a Andriod Java application using gradlew. The thing is if i need to download from the internet I need to use proxy. For which I have configured my andriod and gradle to use the proxy setting.

I am able to download packages from the commandline using command

  • Is it possible to run android emulator / android apps in docker?
  • Connecting to a USB Android Device in a Docker Container via adb
  • Android CI using Bitbucket Pipelines and Docker
  • Building an Android project from the command line with Docker
  • How to run appium test using aluedeke/appium-android docker image?
  • Drone local and local.properties
  • andriod update sdk

    But when i run gradlew it is able to download the dependency from jcentre but it fails trying to download some Andriod package i think. I have pasted the error message below.

    cat /root/.android/androidtool.cfg

    sdkman.force.http=true
    http.proxyHost=gateway.bns 
    http.proxyPort=8000
    

    cat gradle.properties

    systemProp.http.proxyHost=xyz.abc
    systemProp.http.proxyPort=8000
    systemProp.http.nonProxyHosts=*.abc
    systemProp.https.proxyHost=xyz.abc
    systemProp.https.proxyPort=8080
    systemProp.https.nonProxyHosts=*.abc
    

    ./gradlew clean test assemble

    DK is missing a "platforms" directory.
    If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /sdk/ndk-bundle.
    If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
    
    Error:
    
        File /root/.android/repositories.cfg could not be loaded.
        java.net.ConnectException: Connection timed out (Connection timed out)
        IOException: https://dl.google.com/android/repository/addons_list-3.xml
        java.net.ConnectException: Connection timed out (Connection timed out)
        IOException: https://dl.google.com/android/repository/addons_list-2.xml
        java.net.ConnectException: Connection timed out (Connection timed out)
        IOException: https://dl.google.com/android/repository/addons_list-1.xml
        java.net.ConnectException: Connection timed out (Connection timed out)
        Failed to download any source lists!
    

  • How to run docker-compose on remote host?
  • Kubernetes docker sample does not expose a port
  • Cannot import lxml in python:3.4 docker container
  • Can you have a docker copy in the same line as docker run
  • Nexus 3: “Remote Connection Pending…” for docker hub
  • Installing Docker.io on Ubuntu 14.04LTS
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.