Reputation: 68
When I tried to build Xamarin Forms iOS app in the App Center, it is checking the reference of Android and throwing exceptions/issues.
Can anyone know why is this happening ?
PS: Both Android and iOS builds are working fine in local.
Thanks in advance.
Upvotes: 1
Views: 392
Reputation: 3725
Currently, you can not edit the pipeline with yml anymore.
Therefore, add a custom script file to your iOS project, called appcenter-post-clone.sh
as described in the docs, that removes the Android project in the solution, so it won't bother you while restoring
The content of the file should be:
dotnet sln <path to sln (ex: ../../app.sln)> remove <path to Android csproj (ex: ../Android/Android.csproj)>
Make sure after you added the file, that you build the pipeline AGAIN manually, because when the file is added the first time, it won't be activated in the pipeline.
Upvotes: 0
Reputation: 68
Previously, I selected the build configuration is pointing to the .sln (solution) file instead of the (.iOS) project.
Solution : In the build configuration to be select (.iOS) Project
Upvotes: 1
Reputation: 301
Looks like your iOS pipeline is trying to use *.sln file of the whole solution. I guess you should try to build only *.iOS.csproj directly. Below an example of the build iOS project task from *.yml:
- task: XamariniOS@1
displayName: Build App.iOS
inputs:
solutionFile: 'App.iOS/App.iOS.csproj'
configuration: '$(buildConfiguration)'
packageApp: true
runNugetRestore: false
args: '/p:OutputPath=$(outputDirectory)/'
buildToolOption: 'msbuild'
clean: true
Upvotes: 2