unzip android-sdk

harel.mazor's Avatar

harel.mazor

25 Aug, 2018 10:06 PM

The following build takes too long to unzip or it gets stuck?
https://ci.appveyor.com/project/IsraelHikingHost/site/build/7.1.58
What I did:
Run this powershell command:
Invoke-Expression "7z x sdk-tools-windows-4333796.zip -o$env:ANDROID_HOME"

  1. Support Staff 1 Posted by Ilya Finkelshte... on 26 Aug, 2018 06:25 PM

    Ilya Finkelshteyn's Avatar

    It looks like it stuck. Did you try to RDP and see what happened?

    But more importantly, do you really need to install it, please check what is installed already: https://www.appveyor.com/docs/build-environment/#xamarin

  2. 2 Posted by harel.mazor on 26 Aug, 2018 07:43 PM

    harel.mazor's Avatar

    Haven't tried rdping, I expect this to work...
    I'd love not to install it, but I couldn't find any appveyor article on how to use the android sdk from command line.
    I would like to be able to build a cordova project, for that I need to define ANROID_HOME env variable to point to where the sdk is installed.
    Also I need java 1.8 SDK installed, which I hope is a pre-requisite to android.
    Any help would be appreciated.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 27 Aug, 2018 11:19 PM

    Ilya Finkelshteyn's Avatar

    I think that this YAML of one of our clients should give you some inspiration: https://github.com/filmaj/cordova-android/blob/master/appveyor.yml.
    Their build: https://ci.appveyor.com/project/Humbedooh/cordova-android/history

  4. 4 Posted by harel.mazor on 28 Aug, 2018 06:00 AM

    harel.mazor's Avatar

    Thanks for the info! But this doesn't align with what you wrote earlier since they too download the file and unzip it.
    I would like to follow your suggestion and avoid it, but I don't know where the android tools are installed.
    I know I can RDP, but I'm probably not the only one who asks that - therefore I think an appveyor instruction guide is in order here, IMO.
    I think the difference between what I did and what they did that causes the build to get stuck is the " > nul" at the end of the 7z call. I'll give it a try.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 28 Aug, 2018 09:46 PM

    Ilya Finkelshteyn's Avatar

    If you need to get more information on installed SDKs you can run command like this at install stage:

    install:
    - cmd: '"C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat" --list'
    

    If you need to install SDK which does not exist on AppVeyor VM, you can do it with custom script. I found another sample for you: https://github.com/AArnott/PCLCrypto/blob/master/Install-Dependenci...

    We heavily depend on the community when documenting specific SDKs and frameworks build (we are not experts in all possible frameworks). Our documentation and blog sites are open source. Few examples of community contributed docs and blogs:
    https://www.appveyor.com/docs/lang/cpp/
    https://www.appveyor.com/blog/2016/12/23/sonarqube/

    You are very welcome to contribute too :)

  6. 6 Posted by harel.mazor on 28 Aug, 2018 10:14 PM

    harel.mazor's Avatar

    Thanks for the info, I'll see what I can do in order to help out with the docs.
    I managed to build my android app on Appveyor but it too gets stuck at the end of the run - much like the unzip got stuck.
    The solution for the unzip what to pipe it to nul, but I don't think it's a good solution if I want to see what's going on in the logs.
    See my commit here:
    https://github.com/IsraelHikingMap/Site/commit/00567fbc6bdbf790dee6...
    Can you please check that this is not something related to stdout when running a process in appveyor code?
    When I run it locally on my PC the command finishes without hanging.
    https://ci.appveyor.com/project/IsraelHikingHost/site/build/7.1.72
    The log is long due to android stuff...

  7. Support Staff 7 Posted by Ilya Finkelshte... on 30 Aug, 2018 08:26 PM

    Ilya Finkelshteyn's Avatar

    RDP was added exactly for cases like this, so people can debug their scripts. Local machine debug is not good place as it may have some dependencies already installed and generally different from clean VM. If you are not willing to debug, we can debug your scripts for you, but cannot give any promises how soon.
    If you decide to go ahead and RDP, remember 2 things:

    • Do not set APPVEYOR_RDP_PASSWORD, we having intermittent issue with it right now. AppVeyor will generate random password for you.

    • Build environment variables are not available in RDP session (for security reasons) so you may need to re-set the ones required by the script.

  8. 8 Posted by harel.mazor on 02 Sep, 2018 11:50 AM

    harel.mazor's Avatar

    It would help a lot if you could take a look.
    I have currently disabled the code that gets stuck in order to have artifacts for my site.
    The following commit is the comment-out of the hanging code:
    https://github.com/IsraelHikingMap/Site/commit/d9fb94e39d730263fe61...
    I'll update here in case I get to RDP to debug it.

  9. 9 Posted by harel.mazor on 10 Sep, 2018 03:19 PM

    harel.mazor's Avatar

    I've RDP to the computer removed the file so that the build will continue, let the agent run the last command and it got stuck.
    I've ran the same command using powershell and it finished OK while the build was running.
    Any chance to get assistance here?
    I'm not sure how to make this work... :-((
    https://ci.appveyor.com/project/IsraelHikingHost/site/build/7.2.3

  10. 10 Posted by harel.mazor on 10 Sep, 2018 07:09 PM

    harel.mazor's Avatar

    I'm hoping the root cause of my issue is described here:
    https://github.com/appveyor/ci/issues/1745
    I'll try and see if the suggested workaround there solves my problem.
    In case it does, I suggest to document this somewhere...

  11. Support Staff 11 Posted by Ilya Finkelshte... on 10 Sep, 2018 07:32 PM

    Ilya Finkelshteyn's Avatar

    Thanks for keeping us in touch. Please let us know how it goes.

  12. 12 Posted by harel.mazor on 10 Sep, 2018 09:53 PM

    harel.mazor's Avatar

    The following seems to have fixed the problem:
    environment:
    GRADLE_OPTS: "-Dorg.gradle.daemon=false"

    I copied this solution form cordova-android repository, seem like I'm not the first one to encounter this issue.
    It has to do with gradle deamon getting stuck.
    I suggest to set this environment variable by default to reduce a lot of time the next person will have to waste trying to fix this...

  13. Support Staff 13 Posted by Ilya Finkelshte... on 10 Sep, 2018 11:09 PM

    Ilya Finkelshteyn's Avatar

    Excellent, thanks a lot!

  14. Ilya Finkelshteyn closed this discussion on 10 Sep, 2018 11:09 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac