DSYM file is not uploaded to firebase while running build in azure CI Environment

Viewed 1128

I'm trying to upload dsym file to firebase. I've followed firebase tutorial. Everything worked fine when i was building app from xcode. Issue occurred when i tried to do it using azure pipelines. I have added build phase to my xcode build. It looks like this

After running it in CI environment i got this result:

Debug mode enabled Running in a CI Environment Not running in an instance of Xcode.app Crashlytics is not installed Google App ID: 1:xxxx Platform: ios DSYM Paths: ["/.../BuildProductsPath/Test-iphoneos/App.app.dSYM"] Validation succeeded. Exiting because upload-symbols was run in validation mode

But after testings my app, I receive crash report with missing dsym in Crashlytics dashboard.

Is there any way to add more logging or check already uploaded dsym files to firebase? Maybe i've missed some additional configurations.

EDIT-1:

My build pipeline looks like this:

pool:
  vmImage: 'macOS-latest'

trigger:
- master

steps:
- checkout: self
  submodules: true
  clean: true

- script: /usr/local/bin/pod install
  displayName: 'pod install using a script'

- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: 'xxx.p12'
    certPwd: '$(P12Password)'
    keychain: 'temp'

- task: InstallAppleProvisioningProfile@1
  inputs:
    provisioningProfileLocation: 'secureFiles'
    provProfileSecureFile: 'xxx.mobileprovision'

- task: ios-bundle-version@1
  inputs:
    sourcePath: 'App/Info.plist'
    versionCodeOption: 'buildid'
    versionCode: '$(Build.BuildId)'
    versionName: '1.0.$(Build.BuildId)'
    printFile: true

- task: Xcode@5
  inputs:
    actions: 'clean build archive'
    xcWorkspacePath: '**/App.xcworkspace'
    scheme: 'App'
    packageApp: true
    signingOption: 'manual'
    provisioningProfileName: 'xxx'
    args: 'SWIFT_VERSION=5.0'
    useXcpretty: false


- task: CopyFiles@2
  inputs:
    contents: '**/*.ipa'
    targetFolder: '$(build.artifactStagingDirectory)'

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '$(build.artifactStagingDirectory)' 
    artifactName: 'drop' 
    publishLocation: 'Container'

In pod file i have those lines:

#Firebase
  pod 'Firebase/Performance'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Analytics'
1 Answers

Issue appeared to be in the export option plist file, which was set to autogenerate in 'task: Xcode@5'. In this file there is a flag compileBitcode. By default it was set to 'Yes' and it was the issue. After exporting the .ipa file with this option, dsym files produced during build are not valid.

In my case i've just added custom ExportOptionsTestEnv.plist file. You can generate this file by archiving your app from xcode and distribute it with ad hoc configuration.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <false/>
    <key>destination</key>
    <string>export</string>
    <key>method</key>
    <string>ad-hoc</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>YOURBUNDLEID</key>
        <string>PROVISIONINGPROFILENAME</string>
    </dict>
    <key>signingCertificate</key>
    <string>Apple Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>TEAMID</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>

And changed build configuration to look like this:

    - task: Xcode@5
      inputs:
        actions: 'clean build archive'
        xcWorkspacePath: '**/App.xcworkspace'
        scheme: 'App'
        packageApp: true
        exportOptions: 'plist'
        exportOptionsPlist: 'ExportOptions/ExportOptionsTestEnv.plist'
        signingOption: 'manual'
        provisioningProfileName: 'xxx'
        args: 'SWIFT_VERSION=5.0'
        useXcpretty: false

Just have on mind that this solution won't work with TestFlight and AppleStore, because those services require compileCode flag enabled.

Possible solution to this would be fastlane deployments. In documentation they write that this is supported: upload_symbols_to_crashlytics

Related