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

Pipeline is failing in "Xcode@5"(Build and Sign) task for ios app #17114

Closed
charmipatalia opened this issue Nov 1, 2022 · 18 comments
Closed
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Release Task: Xcode

Comments

@charmipatalia
Copy link

Type: Azure Pipeline

Pipeline is failing in "Xcode@5"(Build and Sign) task for ios app

Environment

  • Server - Azure Pipelines
    Account name : c.patalia
    Team project name : MobileApp-iOS
    Build number : 1.43.0

  • Microsoft Hosted Agent
    Agent specification: MacOS-12
    Agent version: 2.211.1

Issue Description

I am using Azure pipelines to upload my iOS apps to TestFlight. It was working fine before but recently I changed the vmImage to "macOS-12" in .yml file with xCode 14.0.1 and after that pipeline is failing in "Xcode@5" task with error code 65.

In .yml file, in Xcode@5 task for "signingOption", I tried "auto" and"manual" both but issue is same in both cases. If I use "default" than it is failing with error code 70.

I also updated my certificates and profiles recently so it seems no error related to that and also build is successfully uploaded by Xcode but it is giving error in pipeline.

I am attaching the error logs for both the cases.

Here is task description in .yml file

task: Xcode@5
displayName: Build and Sign

inputs:
workingDirectory: '$(workingDirectory)'
xcWorkspacePath: '$(workingDirectory)/EvolutionWellness.xcworkspace'
actions: 'build'
sdk: 'iphoneos16.0'
scheme: '$(scheme)'
configuration: 'Release PROD'
packageApp: true
exportPath: '$(system.defaultworkingdirectory)'
signingOption: 'manual'
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
teamId: 'G7GD45FUCY'
args: '-verbose'

Error logs

Errorcode65.txt
Errorcode70.txt

@github-actions github-actions bot added Area: Release environment:need-to-triage Issues need to be triage by environment-deployment team triage labels Nov 1, 2022
@kirill-ivlev
Copy link
Contributor

Hi @charmipatalia.
Thank you for reporting this, we will take a look

@kirill-ivlev kirill-ivlev added Area: ABTT Akvelon Build Tasks Team area of work Task: Xcode and removed triage environment:need-to-triage Issues need to be triage by environment-deployment team labels Nov 1, 2022
@DmitriiBobreshev DmitriiBobreshev self-assigned this Nov 2, 2022
@DmitriiBobreshev
Copy link
Contributor

Hi @charmipatalia, could you please say do you have some not native project like Apache Cordova/React Native? This code means that some Input Data is incorrect in some way.

Probably it happens because you switch xcode version without update the project. In case if it's some note native project reconfigure will help (examples for react and cordova apps). In case if you have native application, could you please check project via xcode(if you have this possibility), or get us some simple app examples in case if it possible

@charmipatalia
Copy link
Author

Hey @DmitriiBobreshev , Thanks for looking into it. I have the native iOS application and if I try to deploy the app with Xcode than it is working fine but failing in this step in the pipeline.

@DmitriiBobreshev
Copy link
Contributor

@charmipatalia, thanks for the answer, are you using Xcode 14 on your machine? Seems like Xcode on your machine modified some input data to be able to build the project. Do you use Cocoapod install before building in your pipeline?
Also, you can specify the version of Xcode by using the bash task:

- bash: xcodebuild -version
- bash: '/bin/bash -c "sudo xcode-select -s /Applications/Xcode_${{ parameters.xcode_version }}.app/Contents/Developer"'
  displayName: 'Set Xcode ${{ parameters.xcode_version }} as default'
- bash: xcodebuild -version

Also, there is a list of all available versions for macos-11 and macos-12

@charmipatalia
Copy link
Author

Hello @DmitriiBobreshev , yeah I am using Xcode 14.0.1 in my machine and also using cocoapods install in the pipeline. So here you mean I need to mention the version of xcode in script? Pipeline is already using 14.0.1 by default.

I am also wondering that if I use 'macOS-Latest' instead of 'macOS-12' than it is working fine(It will use XCode 13) but there is warning that you need to use macOS-12 soon.

you have any idea on that?

@DmitriiBobreshev
Copy link
Contributor

DmitriiBobreshev commented Nov 10, 2022

Hi @charmipatalia, thank's for your answer, I just thought that maybe your app wasn't built on Xcode 14 yet, so it's not migrated.
In that case could you please run the pipeline with debug variable and attach the logs. In case you don't want to share logs here you can write me by email at [email protected]

And if it's possible let's exclude signature participation. Could you run your pipeline with just build for simulator, something like this:

- task: Xcode@5
  displayName: Build
  inputs:
    workingDirectory: '$(workingDirectory)'
    xcWorkspacePath: '$(workingDirectory)/EvolutionWellness.xcworkspace'
    actions: 'build'
    sdk: 'iphoneos16.0'
    scheme: '$(scheme)'
    configuration: 'Release'
    packageApp: False
    exportPath: '$(system.defaultworkingdirectory)'
    args: '-verbose'

@joxenford
Copy link

I am seeing similar behavior on Xcode@5. I cannot reproduce this error using Xcode locally using the same xcodebuild command.
2022-11-17T15:38:48.2771670Z ##[debug]Ev.txt

 task: Xcode@5
  displayName: "Build iOS Application"
  inputs:
    actions: "clean"
    xcWorkspacePath: "**/project.xcworkspace"
    scheme: "$(XCodeScheme)"
    configuration: "$(XCodeConfiguration)"
    packageApp: true
    signingOption: "default"
    archivePath: "$(Build.ArtifactStagingDirectory)/xcarchive"
    exportPath: "$(Build.ArtifactStagingDirectory)/ipa"
    exportOptions: "plist"
    exportOptionsPlist: "$(Build.ArtifactStagingDirectory)/exportOptions.plist"

This was working fine about 4 days ago and just started to fail this week

@DmitriiBobreshev
Copy link
Contributor

@jstoker, based on your logs it might be related to react-native itself, are you using code version 14.0.1 locally(the same as in pipeline)?

@DmitriiBobreshev
Copy link
Contributor

Hi @jstoker, @charmipatalia, closing this issue due to inactivity and inability to reproduce the error, please feel free to reopen the problem, and provide some simple examples of the project if it's possible.

@charmipatalia
Copy link
Author

Now I managed to fix the issue by using "default" as "signingOption" in Xcode@5 task,
I have used manual signing in my project so it will take that default setting.

  • task: Xcode@5
    displayName: Build and Sign
    inputs:
    workingDirectory: '$(workingDirectory)'
    xcWorkspacePath: '$(workingDirectory)/EvolutionWellness.xcworkspace'
    actions: 'build'
    sdk: 'iphoneos'
    scheme: '$(scheme)'
    configuration: 'Release UAT'
    packageApp: true
    exportPath: '$(system.defaultworkingdirectory)'
    signingOption: 'default'
    signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
    provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
    useXcpretty: false
    teamId: 'G7GD45FUCY'
    args: '-verbose'
    exportOptions: 'plist'
    exportOptionsPlist: '$(workingDirectory)/ExportOptions.plist'

@namrata690
Copy link

Hi @charmipatalia @joxenford @DmitriiBobreshev I am also facing similar issue.
I tried the solution posted above but it doesn't work. We also get error code 65.

@charmipatalia
Copy link
Author

Hello @namrata690 , will you please give more details like which signing option are you using? and also make sure all the provisioning profiles and certificates are up to date.

@namrata690
Copy link

Thanks @charmipatalia updating provisioning profiles worked.

@Nathan187
Copy link

I'm having the damndest time getting this to work. It constantly says my App project file or workspace file is corrupt. If I run it locally, it works fine. But it keeps complaining about the project/workspace file is corrupt. I'm trying to build my ionic ios app using a different scheme/configuration. It just doesn't freaking work for some reason. I think the error is probably misleading but still....annoying

Command line invocation:
2023-10-14T22:15:59.7465680Z /Applications/Xcode_14.3.1.app/Contents/Developer/usr/bin/xcodebuild -project App.xcodeproj -list
2023-10-14T22:15:59.7466820Z
2023-10-14T22:15:59.7467080Z User defaults from command line:
2023-10-14T22:15:59.7467310Z IDEPackageSupportUseBuiltinSCM = YES
2023-10-14T22:15:59.7467460Z
2023-10-14T22:16:07.1186390Z 2023-10-14 22:16:07.095 xcodebuild[18038:91570] Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}
2023-10-14T22:16:07.1202930Z 2023-10-14 22:16:07.098 xcodebuild[18038:91570] Writing error result bundle to /var/folders/r_/vbvvglrx3lvds6dp_mbyq3_c0000gn/T/ResultBundle_2023-14-10_22-16-0007.xcresult
2023-10-14T22:17:04.2288640Z xcodebuild: error: Unable to read project 'App.xcodeproj'.
2023-10-14T22:17:04.2289760Z Reason: The project ‘App’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.
2023-10-14T22:17:04.2290750Z
2023-10-14T22:17:04.2290970Z Path: /Users/runner/work/1/s/ios/App/App.xcodeproj
2023-10-14T22:17:04.2291130Z
2023-10-14T22:17:04.2291210Z

2023-10-14T22:17:05.8369320Z 2023-10-14 22:17:05.836 xcodebuild[18383:93104] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
2023-10-14T22:17:05.8394590Z Command line invocation:
2023-10-14T22:17:05.8395750Z /Applications/Xcode_14.3.1.app/Contents/Developer/usr/bin/xcodebuild -workspace App.xcworkspace -list
2023-10-14T22:17:05.8395970Z
2023-10-14T22:17:05.8397720Z User defaults from command line:
2023-10-14T22:17:05.8398940Z IDEPackageSupportUseBuiltinSCM = YES
2023-10-14T22:17:05.8401960Z
2023-10-14T22:17:06.2354650Z 2023-10-14 22:17:06.235 xcodebuild[18383:93104] Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}
2023-10-14T22:17:06.2359370Z 2023-10-14 22:17:06.235 xcodebuild[18383:93104] [MT] IDEFileReferenceDebug: [Load] <IDEFileReference, 0x600002804b00: name:App path:group:App.xcodeproj> Failed to load container at path: /Users/runner/work/1/s/ios/App/App.xcodeproj, Error: Error Domain=Xcode3ProjectErrorDomain Code=2 "The project ‘App’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.
2023-10-14T22:17:06.2360190Z
2023-10-14T22:17:06.2360840Z Path: /Users/runner/work/1/s/ios/App/App.xcodeproj" UserInfo={NSLocalizedDescription=The project ‘App’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.
2023-10-14T22:17:06.2361180Z
2023-10-14T22:17:06.2361390Z Path: /Users/runner/work/1/s/ios/App/App.xcodeproj}
2023-10-14T22:17:06.2361840Z --- xcodebuild: WARNING: Unable to open project file '/Users/runner/work/1/s/ios/App/App.xcodeproj' in workspace 'App.xcworkspace'.
2023-10-14T22:17:06.5566770Z Information about workspace "App":
2023-10-14T22:17:06.5567110Z Schemes:
2023-10-14T22:17:06.5567950Z BranchSDK
2023-10-14T22:17:06.5569720Z Capacitor
2023-10-14T22:17:06.5569910Z CapacitorApp
2023-10-14T22:17:06.5570170Z CapacitorAppLauncher
2023-10-14T22:17:06.5574820Z CapacitorBranchDeepLinks
2023-10-14T22:17:06.5575080Z CapacitorCamera
2023-10-14T22:17:06.5575290Z CapacitorCordova
2023-10-14T22:17:06.5575480Z CapacitorDevice
2023-10-14T22:17:06.5575680Z CapacitorFilesystem
2023-10-14T22:17:06.5575890Z CapacitorGeolocation
2023-10-14T22:17:06.5576140Z CapacitorKeyboard
2023-10-14T22:17:06.5576340Z CapacitorLocalNotifications
2023-10-14T22:17:06.5576530Z CapacitorNetwork
2023-10-14T22:17:06.5576720Z CapacitorPreferences
2023-10-14T22:17:06.5576920Z CapacitorPushNotifications
2023-10-14T22:17:06.5577120Z CapacitorSplashScreen
2023-10-14T22:17:06.5577360Z CapacitorStatusBar
2023-10-14T22:17:06.5577550Z CapawesomeCapacitorBadge
2023-10-14T22:17:06.5577790Z CapawesomeCapacitorScreenOrientation
2023-10-14T22:17:06.5578160Z CordovaPlugins
2023-10-14T22:17:06.5578370Z IonicEnterpriseIntune
2023-10-14T22:17:06.5578780Z Pods-App
2023-10-14T22:17:06.5578990Z ProteansoftwareCapacitorStartNavigation

@charmipatalia
Copy link
Author

Hey @Nathan187 , I suggest you to try these options,

  • Issue is somewhere in file from this errorlog - "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.", so check your all the files in code, If anything is added by mistake in sourcetree
  • Try to recreate.xcodeworkspace file first and if still the issue try to recreate .xcodeproj file

Before doing any of this, please create a backup copy and then try

@Nathan187
Copy link

thank you for the response @charmipatalia

to your second bullet point, i'm not really sure what you mean or how to go about recreating the workspace file.

i don't understand why i don't have these problems locally. the pipelines download the project (files) and I get this error in the xcode 5 step. this xcode project/workspace was created by the ionic build (capacitor command). i had to add the different configuration and scheme....works fine locally. looking at the project file in a text editor...the first line has this crap (// !$UTF8$!) for some reason....but it doesn't prevent other configuration/schemes (Release/App) from building. ugh....so annoying

@charmipatalia
Copy link
Author

Hey @Nathan187 , to recreate workspace you need to delete .xcworkspace file and run 'pod install' command, it will recreate the workspace

By any chance have you tried creating archive locally? Is it successful?

@Nathan187
Copy link

ok, @charmipatalia , after a 2nd set of eyes...i saw that before performing the xcode@5 task, i was altering the info.plist file an the xcodeproj file using putil and sed. some variables i was using when doing this were commented out. so indeed my project file(s) were corrupt

also, looking at another posting by a different user...his problem was very close to mine. he mentioned that it was a signing error which had me examining closer. i noticed that i did not copy all provisioning files over (i have provisioning files for different schemes).

thank you for responding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work Area: Release Task: Xcode
Projects
None yet
Development

No branches or pull requests

7 participants