Search Unity

[CI] Switching to AndroidPlayer is disabled

Discussion in 'Editor & General Support' started by mperepelkin_at_melscience, Mar 6, 2017.

  1. mperepelkin_at_melscience

    mperepelkin_at_melscience

    Joined:
    Aug 20, 2014
    Posts:
    4
    Hello,

    I have a problem setting up environment for Unity Android build on CI machine (OS X). I want to configure and run builds via command line.

    I've gone through machine configure with Android SDK installation and Unity & Android platform plugin installation from the command line.
    When I try to build Android build in batch mode from the command line I keep on getting Android target error:
    > Building a player for 'Android' (13) target is not supported in this Unity build.

    Seems like Unity Android platform plugin doesn't get registered, though package installation is successful as I can see from logs.
    I saw a thread with the same problem and a suggestion to export paths, but it doesn't help either.
    Could you please help me to figure out, what I am missing? Is there generally a way to register and build Android target without a GUI tuning?

    Technical details:

    1. Environment setup:

    Env is set up with following commands. All phases pass with positive results, Unity installation logs are attached to the letter.

    brew install android-sdk
    echo y | android update sdk --no-ui --all --filter "android-25,build-tools-25.0.2platform-tools,extra-android-m2repository,extra-google-m2repository"

    curl -o Unity.pkg http://netstorage.unity3d.com/unity/38b4efef76f0/MacEditorInstaller/Unity-5.5.0f3.pkg
    curl -o Unity-Android.pkg http://netstorage.unity3d.com/unity...ySetup-Android-Support-for-Editor-5.5.0f3.pkg

    sudo installer -dumplog -package Unity.pkg -target /
    sudo installer -dumplog -package Unity-Android.pkg -target /

    2. Build script

    Build script looks like:

    Unity -projectPath PROJ_PATH -batchmode -nographics -serial XXXX -username XXXX -password XXXX -logFile /dev/stdout -executeMethod AndroidGradleBuilder.Build -quit

    AndroidGradleBuilder.cs switches to BuildTarget.Android and manages build through AndroidBuildSystem.Gradle

    Unity runs build but fails on the plugin step:

    > Refreshing native plugins compatible for Editor in 0.02 ms, found 0 plugins.
    ...
    > Switching to AndroidPlayer is disabled
    (Filename: Line: -1)
    *** Cancelled 'Build.SwitchBuildTargetEmulation.AndroidPlayer' in 0 seconds (0 ms)

    Full logs attached
     

    Attached Files: