Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] fix nightly CI builds #5864

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

jonathanpeppers
Copy link
Member

The nightly TimeZone and System App tests are failing with:

error XA0030: Building with JDK version `14.0.2` is not supported. Please install JDK version `11.0`.
See https://aka.ms/xamarin/jdk9-errors

Earlier in the log:

JI_JAVA_HOME = /Users/runner/Library/Android/
...
warning XA5300: An exception occurred while validating the Java SDK installation in '/Users/runner/Library/Android/' that was found while searching the paths from '$JI_JAVA_HOME'.
Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured.
To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.
Exception: Could not find required file `jar` within `/Users/runner/Library/Android/`; is this a valid JDK?
    Parameter name: homePath

It turns out that JI_JAVA_HOME isn't quite right because of
setup-test-environment.yaml's default value for jdkTestFolder:

jdkTestFolder: $(XA.Jdk11.Folder)

azure-pipelines-nightly.yaml doesn't set $(XA.Jdk11.Folder), and
so $JI_JAVA_HOME would have an incorrect path:

- script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/${{ parameters.jdkTestFolder }}"
  displayName: set JI_JAVA_HOME
  condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))

Things were only working before, because xamarin-android-tools used
to be able to locate the old Microsoft OpenJDK 1.8 and that code was
removed.

The nightly TimeZone and System App tests are failing with:

    error XA0030: Building with JDK version `14.0.2` is not supported. Please install JDK version `11.0`.
    See https://aka.ms/xamarin/jdk9-errors

Earlier in the log:

    JI_JAVA_HOME = /Users/runner/Library/Android/
    ...
    warning XA5300: An exception occurred while validating the Java SDK installation in '/Users/runner/Library/Android/' that was found while searching the paths from '$JI_JAVA_HOME'.
    Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured.
    To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.
    Exception: Could not find required file `jar` within `/Users/runner/Library/Android/`; is this a valid JDK?
        Parameter name: homePath

It turns out that `JI_JAVA_HOME` isn't quite right because of
`setup-test-environment.yaml`'s default value for `jdkTestFolder`:

    jdkTestFolder: $(XA.Jdk11.Folder)

`azure-pipelines-nightly.yaml` doesn't set `$(XA.Jdk11.Folder)`, and
so `$JI_JAVA_HOME` would have an incorrect path:

    - script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/${{ parameters.jdkTestFolder }}"
      displayName: set JI_JAVA_HOME
      condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))

Things were only working before, because xamarin-android-tools *used*
to be able to locate the old Microsoft OpenJDK 1.8 and that code was
removed.
@jonathanpeppers
Copy link
Member Author

@jonathanpeppers jonathanpeppers marked this pull request as ready for review April 22, 2021 21:43
@jonathanpeppers
Copy link
Member Author

/cc @dellis1972 I think the latest System App test is a real failure now:

"/Users/runner/work/1/s/bin/TestRelease/temp/SystemApplicationCanInstall/UnnamedProject.csproj" (Build;Install target) (1) ->
(_Upload target) -> 
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(603,5): error XA0127: Error deploying /data/user/0/com.xamarin.systemapplicationcaninstall/files/.__override__/UnnamedProject.dll using xamarin.sync: error: could not open '/data/user/0/com.xamarin.systemapplicationcaninstall/files/.__override__/UnnamedProject.dll'.. Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'. [/Users/runner/work/1/s/bin/TestRelease/temp/SystemApplicationCanInstall/UnnamedProject.csproj]

    0 Warning(s)
    1 Error(s)

We can fix that in another PR.

@jonpryor
Copy link
Member

That error message might become more "interesting" once #5860 lands…?

@dellis1972
Copy link
Contributor

/cc @dellis1972 I think the latest System App test is a real failure now:

"/Users/runner/work/1/s/bin/TestRelease/temp/SystemApplicationCanInstall/UnnamedProject.csproj" (Build;Install target) (1) ->
(_Upload target) -> 
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(603,5): error XA0127: Error deploying /data/user/0/com.xamarin.systemapplicationcaninstall/files/.__override__/UnnamedProject.dll using xamarin.sync: error: could not open '/data/user/0/com.xamarin.systemapplicationcaninstall/files/.__override__/UnnamedProject.dll'.. Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'. [/Users/runner/work/1/s/bin/TestRelease/temp/SystemApplicationCanInstall/UnnamedProject.csproj]

    0 Warning(s)
    1 Error(s)

We can fix that in another PR.

err what... that was working :(

@jonathanpeppers jonathanpeppers merged commit 7f32ef0 into dotnet:main Apr 23, 2021
@jonathanpeppers jonathanpeppers deleted the fix-nightly-jobs branch April 23, 2021 12:59
@Axemasta
Copy link

Axemasta commented Jun 4, 2021

I'm noticing that my CI builds have fallen over due to this issue:

"/Users/runner/work/1/s/src/*****.sln" (default target) (1) ->
"/Users/runner/work/1/s/src/App/*****.Controls/*****.Controls.csproj" (default target) (6:36) ->
"/Users/runner/work/1/s/src/App/*****.Controls/*****.Controls.csproj" (Build target) (6:39) ->
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Legacy.targets(248,5): error XA0030: Building with JDK version `14.0.2` is not supported. Please install JDK version `11.0`. See https://aka.ms/xamarin/jdk9-errors [/Users/runner/work/1/s/src/App/*****.Controls/*****.Controls.csproj]

This is only on my azure devops pipeline, i have 3 local machines that can build the forms project perfectly. I'm not quite sure what I need to update, I had a look at your pipeline and it seems to be setting environment variables from a script task. I tried adding:

- script: |
    echo ##vso[task.setvariable variable=JI_JAVA_HOME]%USERPROFILE%\android-toolchain\$(XA.Jdk11.Folder)
  displayName: set JI_JAVA_HOME

To my task (obviously setting the variable to XA.Jdk11.Folder: jdk-11) but it still failed with the same error? My last successful build was 04-May-2021 so im wondering if my issue is related to this. Otherwise I can re-raise this as a seperate issue 😀

@jonathanpeppers
Copy link
Member Author

@Axemasta can you raise a new issue, and provide a bit more of the build log?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants