xamarin.iosazure-devopsvisual-studio-app-center-distribute

Automate builds using AppCenter


I am trying to automate a build for Xamarin.iOS using AppCenter. I have got three projects 4 projects as part of this.

  1. TestProj (Xamarin Forms Core Project)
  2. TestProj.iOS
  3. Notification Service Extension project
  4. Share Service Extension project

When I build the project, appcenter fails to restore the nuget for the "Notification Service Extension" project. The error that I get is :

NotificationService.cs(2,7): error CS0246: The type or namespace name 'Com' could not be found (are you missing a using directive or an assembly reference?)

Note: Com is the "Com.OneSignal" nuget package.

The configuration for the project is as follows:

Note: I have added all provisioning profiles and I also have Pre-build script added to the project which is automatically detected. Script has the code to restore nuget for the solution.

#!/usr/bin/env bash
find $APPCENTER_SOURCE_DIRECTORY -name '*.sln' -print0 | xargs -0 -n1 nuget restore -DisableParallelProcessing

I would appreciate if someone could help me with this


Solution

  • There were two different issues with the automated build.

    1. The version number of the nuget in visual studio package folder(solution pane) was different from what was there in csproj file.
    2. The version number was also different from what I had in my ios and xamarin forms project.

    I believe the reason why the app was building and working locally for me was because, I had the old package a while ago, and it was still existing in the packages folder in solution.