question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ios build fails in Azure

See original GitHub issue

Description

Running build targeting ios in Azure pipeline after signing in build step appsettings.json : error : The path ‘…/…/…/…/…/…/…/work/1/s/[NAME]/appsettings.json’ would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME]/[NAME].csproj] appsettings.json : error : [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj] Web/typescript/package-lock.json : error : The path ‘…/…/…/…/…/…/…/work/1/s/[NAME]/Web/typescript/package-lock.json’ would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj] Web/typescript/package-lock.json : error : [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj] Web/typescript/package.json : error : The path ‘…/…/…/…/…/…/…/work/1/s/[NAME].App/Web/typescript/package.json’ would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj] Web/typescript/package.json : error : [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj] Web/typescript/tsconfig.json : error : The path ‘…/…/…/…/…/…/…/work/1/s/[NAME].App/Web/typescript/tsconfig.json’ would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj] Web/typescript/tsconfig.json : error : [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj]

identifier changed to [NAME]

This stops the build process …

Steps to Reproduce

Setup build pipe , I used the following template

trigger:

  • master

pool: vmImage: macos-latest

steps:

  • task: InstallAppleCertificate@2 inputs: certSecureFile: ‘MyDistributionCertificate.p12’ certPwd: ‘$(certificatePassword)’ keychain: ‘temp’

  • task: InstallAppleProvisioningProfile@1 inputs: provisioningProfileLocation: ‘secureFiles’ provProfileSecureFile: ‘MyProvisioningProfile.mobileprovision’

  • task: UseDotNet@2 inputs: packageType: ‘sdk’ version: ‘6.x’

  • task: CmdLine@2 displayName: ‘dotnet workload install maui’ inputs: script: ‘dotnet workload install maui’

  • task: DotNetCoreCLI@2 displayName: ‘dotnet publish (Release)’ inputs: command: ‘publish’ publishWebProjects: false projects: ‘MyMAUIProject.sln’ arguments: ‘-f:net6.0-ios -c:Release /p:ArchiveOnBuild=true /p:EnableAssemblyILStripping=false’ zipAfterPublish: false modifyOutputPath: false

  • task: CopyFiles@2 inputs: SourceFolder: ‘$(Agent.BuildDirectory)’ Contents: ‘**/*.ipa’ TargetFolder: ‘$(Build.ArtifactStagingDirectory)’ flattenFolders: true

  • task: PublishBuildArtifacts@1 inputs: PathtoPublish: ‘$(Build.ArtifactStagingDirectory)’ ArtifactName: ‘drop’ publishLocation: ‘Container’

Set up signing .

Run pipe .

Link to public reproduction project repository

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

macos-latest , Ios

Did you find any workaround?

No

Relevant log output

appsettings.json : error : The path '../../../../../../../work/1/s/[NAME]/appsettings.json' would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME]/[NAME].csproj]
appsettings.json : error :          [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj]
Web/typescript/package-lock.json : error : The path '../../../../../../../work/1/s/[NAME]/Web/typescript/package-lock.json' would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj]
Web/typescript/package-lock.json : error :          [/Users/runner/work/1/s/[NAME]/[NAME].App.csproj]
Web/typescript/package.json : error : The path '../../../../../../../work/1/s/[NAME].App/Web/typescript/package.json' would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj]
Web/typescript/package.json : error :          [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj]
Web/typescript/tsconfig.json : error : The path '../../../../../../../work/1/s/[NAME].App/Web/typescript/tsconfig.json' would result in a file outside of the app bundle and cannot be used. [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj]
Web/typescript/tsconfig.json : error :          [/Users/runner/work/1/s/[NAME].App/[NAME].App.csproj]

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rolfbjarnecommented, Nov 23, 2022

@datvm you can also set the PublishFolderType=None metadata on the items to prevent them from being copied to the app bundle:

<Content Include="tsconfig.json" PublishFolderType="None" />
0reactions
datvmcommented, Nov 23, 2022

@rolfbjarne thanks it works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Pipeline is failing in "Xcode@5" task with error
I am using Azure pipelines to upload my iOS apps to TestFlight. ... also build is successfully uploaded by Xcode but it is...
Read more >
Xcode build fails in Azure Devops Pipeline
I am using an Azure Devops Build pipeline CI to build my Xcode workspace. It is working fine on local and runs well...
Read more >
Xcode 14.1 keeps failing to build without any information ...
Description I tried to update our pipelines to use Xcode 14. The build logs show: /usr/bin/xcodebuild -version Xcode 14.1 Build version ...
Read more >
Azure DevOps build fails building iOS project with error ...
Hello, The recent update appears to have caused the build process to break in Azure DevOps. This may be a problem for MS...
Read more >
Xamarin.iOS app build fails only on "Azure Pipelines" ...
Hello! I'm facing an issue while building a Xamarin.iOS app on Azure DevOps hosted macOS agents. The error could not be reproduced on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found