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

AzureDevOps build "No value was provided for the Manifest" #281

Open
Seuleuzeuh opened this issue Jul 22, 2021 · 6 comments
Open

AzureDevOps build "No value was provided for the Manifest" #281

Seuleuzeuh opened this issue Jul 22, 2021 · 6 comments
Labels

Comments

@Seuleuzeuh
Copy link

Seuleuzeuh commented Jul 22, 2021

Description

Hi @dansiegel, first of it, thanks for this awsome package 😸.
I've a Xamarin.Forms App with an Android platform. I've implemented BuildTools on it, works perfectly on local machine (Windows & MacOS).
But failed in an AzureDevOps pipeline.

Problems raised by the msbuild (full build log is attached) :

/Users/runner/.nuget/packages/mobile.buildtools/2.0.245/build/AndroidManifest.targets(28,5): warning : No value was provided for the Manifest. Unable to process Manifest Tokens

And

/Users/runner/.nuget/packages/mobile.buildtools/2.0.245/build/AndroidManifest.targets(48,5): error MSB4044: The "AutomaticBuildVersioningTask" task was not given a value for the required parameter "ManifestPath".

Thing to notice, the ImageResizerTask run succesfully.

Reproduction Steps

Don't know

Expected Behavior

Build in AZDevOps like in local machine

Actual Behavior

Build failed whith error MSB4044: The "AutomaticBuildVersioningTask" task was not given a value for the required parameter "ManifestPath"

Environment

  • OS: OSX
  • IDE: CLI
  • BuildTools Version: 2.0.245
  • IDE Version:
  • Build Target Framework: Xamarin.Android

Reproduction App

Part of my Yaml pipeline description :

 - task: NuGetAuthenticate@0

 - task: XamarinAndroid@1
   inputs:
     projectFile: '**/*Droid*.csproj'
     outputDirectory: '$(outputDirectory)'
     configuration: '$(buildConfiguration)'
     msbuildVersionOption: 'latest'
     msbuildArguments: ' /r /verbosity:diag /t:SignAndroidPackage /p:AndroidKeyStore="True" /p:AndroidSigningKeyStore="$(keystore.secureFilePath)" /p:AndroidSigningKeyPass="$(keystorePassword)" /p:AndroidSigningKeyAlias="$(keystoreAlias)" /p:AndroidSigningStorePass="$(keystorePassword)"'

I can share the full Yaml file if needed.

BuildLog.zip

buildBinLog.zip

@dansiegel
Copy link
Owner

It's really hard for me to make any determination here without having a binlog. If you can update the build step's msbuildArguments to include /bl and then publish the binlog on pipeline failure.

- task: NuGetAuthenticate@0

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*Droid*.csproj'
    outputDirectory: '$(outputDirectory)'
    configuration: '$(buildConfiguration)'
    msbuildVersionOption: 'latest'
    msbuildArguments: ' /r /bl /t:SignAndroidPackage /p:AndroidKeyStore="True" /p:AndroidSigningKeyStore="$(keystore.secureFilePath)" /p:AndroidSigningKeyPass="$(keystorePassword)" /p:AndroidSigningKeyAlias="$(keystoreAlias)" /p:AndroidSigningStorePass="$(keystorePassword)"'

- task: PublishPipelineArtifact@1
  displayName: 'Publish Binlog'
  condition: failed()
  inputs:
    artifactName: binlog
    targetPath: 'msbuild.binlog'

@Seuleuzeuh
Copy link
Author

It's really hard for me to make any determination here without having a binlog. If you can update the build step's msbuildArguments to include /bl and then publish the binlog on pipeline failure.

- task: NuGetAuthenticate@0

- task: XamarinAndroid@1
  inputs:
    projectFile: '**/*Droid*.csproj'
    outputDirectory: '$(outputDirectory)'
    configuration: '$(buildConfiguration)'
    msbuildVersionOption: 'latest'
    msbuildArguments: ' /r /bl /t:SignAndroidPackage /p:AndroidKeyStore="True" /p:AndroidSigningKeyStore="$(keystore.secureFilePath)" /p:AndroidSigningKeyPass="$(keystorePassword)" /p:AndroidSigningKeyAlias="$(keystoreAlias)" /p:AndroidSigningStorePass="$(keystorePassword)"'

- task: PublishPipelineArtifact@1
  displayName: 'Publish Binlog'
  condition: failed()
  inputs:
    artifactName: binlog
    targetPath: 'msbuild.binlog'

Done, attached to the description. Sorry for the missing log.

@dansiegel
Copy link
Owner

@Seuleuzeuh the issue is being caused because the _GetAndroidPackageName task is not executing. Can you try replacing the XamarinAndroid task with:

- bash: |
    msbuild \
      ./src/ProjectName.Android/ProjectName.Android.csproj \
      /bl \
      /t:SignAndroidPackage \
      /p:Configuration=Release \
      /p:AndroidKeyStore=true \
      /p:AndroidSigningKeyStore=$KeystoreFile \
      /p:AndroidSigningStorePass=$KeystorePass \
      /p:AndroidSigningKeyAlias=$KeystoreAlias \
      /p:AndroidSigningKeyPass=$KeystorePass \
      /p:AndroidPackageFormat=aab \
      /p:OutputPath=$BuildOutputPath

@Seuleuzeuh
Copy link
Author

@Seuleuzeuh the issue is being caused because the _GetAndroidPackageName task is not executing. Can you try replacing the XamarinAndroid task with:

- bash: |
    msbuild \
      ./src/ProjectName.Android/ProjectName.Android.csproj \
      /bl \
      /t:SignAndroidPackage \
      /p:Configuration=Release \
      /p:AndroidKeyStore=true \
      /p:AndroidSigningKeyStore=$KeystoreFile \
      /p:AndroidSigningStorePass=$KeystorePass \
      /p:AndroidSigningKeyAlias=$KeystoreAlias \
      /p:AndroidSigningKeyPass=$KeystorePass \
      /p:AndroidPackageFormat=aab \
      /p:OutputPath=$BuildOutputPath

Same result... Log attached
build.binlog.zip
BuildLog.zip

@Seuleuzeuh
Copy link
Author

@dansiegel based on your "hack" proposed in this comment, i 've able to fix my build (partially).
The Target _MBTGatherManifests was not launch because the target _GetAndroidPackageName was not listed :

The target "_GetAndroidPackageName" listed in an AfterTargets attribute at "/Users/runner/.nuget/packages/mobile.buildtools/2.0.245/build/AndroidManifest.targets (5,11)" does not exist in the project, and will be ignored.

So i've put this in a Directory.Build.props :

  <Target Name="MBTHack"
          BeforeTargets="HandleAndroidManifest"
          DependsOnTargets="_MBTGatherManifests">
  </Target>

Leading to a build succeed, and a correct generation of the AndroidManifest.
The "partially" is for the final package who is misnamed : x_AppId_.x_AppId_.apk.
I've try another target "hack" but was unable to succeed : the target _ValidateAndroidPackageProperties is run too soon, before the HandleAndroidManifest, so resulting in bad naming. But it's not a blocker.

Finally i think it's due to using a mac agent (i've don't try to use a windows one cause of some script in my yaml that are not compatible, if i have some time i'll try to test that) .

@Seuleuzeuh
Copy link
Author

Finally i think it's due to using a mac agent (i've don't try to use a windows one cause of some script in my yaml that are not compatible, if i have some time i'll try to test that) .

I've made a rework of my build pipeline and made a job that run on windows for Android, and all work smoothly.
So, on a mac agent it's not working properly, i was unable to make it work.

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

No branches or pull requests

2 participants