fastlane: [gym] Fails to Export App on xcode 11.7 & 12.x
tl;dr: this is not a fastlane issue, but rather a bug in react native mapbox pod. For workaround instructions, check: https://github.com/fastlane/fastlane/issues/17712#issuecomment-803613208
New Issue Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
Issue Description
I’m using Fastlane through Circle CI. After upgrading Circle CI xcode version to 12, fastlane and more specifically gym fails to build iOS app and crashes on application export (while archive has succeeded). The behavior is exactly the same trying throughout different xcode versions such as 12.0.1, 12.1.0 and 12.2.0.
The error looks like below:
[20:44:19]: ▸ Archive Succeeded
[20:44:20]: Generated plist file with the following values:
[20:44:20]: ▸ -----------------------------------------
[20:44:20]: ▸ {
[20:44:20]: ▸ "provisioningProfiles": {
[20:44:20]: ▸ "***": "match Development ***",
[20:44:20]: ▸ "****": "match AdHoc ****",
[20:44:20]: ▸ "*****": "match AppStore *****"
[20:44:20]: ▸ },
[20:44:20]: ▸ "method": "ad-hoc",
[20:44:20]: ▸ "signingStyle": "manual"
[20:44:20]: ▸ }
[20:44:20]: ▸ -----------------------------------------
[20:44:20]: $ /usr/bin/xcrun /Users/distiller/.gem/ruby/2.7.2/gems/fastlane-2.162.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/gym_config20201130-7745-1cgsu23.plist' -archivePath /Users/distiller/Library/Developer/Xcode/Archives/2020-11-30/App\ 2020-11-30\ 20.21.29.xcarchive -exportPath '/var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/gym_output20201130-7745-146x6nv'
/tmp/.bash_env-5fc54f0f13bfb2154937fd13-0-build: line 68: unexpected EOF while looking for matching `"'
/tmp/.bash_env-5fc54f0f13bfb2154937fd13-0-build: line 69: syntax error: unexpected end of file
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/gym_config20201130-7745-1cgsu23.plist -archivePath '/Users/distiller/Library/Developer/Xcode/Archives/2020-11-30/App 2020-11-30 20.21.29.xcarchive' -exportPath /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/gym_output20201130-7745-146x6nv
error: archive at path '/Users/distiller/Library/Developer/Xcode/Archives/2020-11-30/App 2020-11-30 20.21.29.xcarchive' is malformed
** EXPORT FAILED **
[20:44:21]: Exit status: 65
I have gone through some issues mentioning similar crash such as #17454 and have tried few different workarounds already but with no success.
Command executed
Fastfile command looks like:
desc 'Fetch certificates, build beta and upload to App Center.'
lane :beta do
certificates
gym(scheme: 'app', workspace: './ios/app.xcworkspace', export_method: 'ad-hoc')
appcenter_upload(
app_name: "#{ENV['IOS_APPCENTER_APP_NAME']}",
file: "#{ENV['IOS_BETA_APPCENTER_IPA_PATH']}",
destinations: "#{ENV['APPCENTER_DISTRIBUTION_GROUP']}",
destination_type: "group",
notify_testers: true,
release_notes: "#{ENV['APPCENTER_DISTRIBUTE_RELEASE_NOTES']}"
)
end
Also certificates command looks like:
desc 'Fetch certificates and provisioning profiles'
lane :certificates do
#only manage a single development cert
match(type: "development", app_identifier: "********", git_branch: ENV["GIT_BRANCH"], team_id: ENV["FASTLANE_TEAM_ID"])
match(type: "adhoc", app_identifier: ENV["BETA_PACKAGE_ID"], git_branch: ENV["GIT_BRANCH"], team_id: ENV["FASTLANE_TEAM_ID"])
match(type: "appstore", app_identifier: ENV["PACKAGE_ID"], git_branch: ENV["GIT_BRANCH"], team_id: ENV["FASTLANE_TEAM_ID"])
end
Complete output when running fastlane, including the stack trace and command used
- Have been trying this with versions 2.162 - 2.168 and the same issue occurs across.
- Have tried approaches such as cleaning xcode build, resolve dependencies and more but nothing seems to work out so far.
Environment
✅ fastlane environment ✅
Stack
| Key | Value |
|---|---|
| OS | 10.15.4 |
| Ruby | 2.6.3 |
| Bundler? | false |
| Git | git version 2.15.0 |
| Installation Source | /usr/local/bin/fastlane |
| Host | Mac OS X 10.15.4 (19E287) |
| Ruby Lib Dir | /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib |
| OpenSSL Version | LibreSSL 2.8.3 |
| Is contained | false |
| Is homebrew | false |
| Is installed via Fabric.app | false |
| Xcode Path | /Applications/Xcode.app/Contents/Developer/ |
| Xcode Version | 12.0.1 |
System Locale
| Variable | Value | |
|---|---|---|
| LANG | en_GB.UTF-8 | ✅ |
| LC_ALL | ||
| LANGUAGE |
fastlane files:
`./fastlane/Fastfile`
platform :ios do
before_all do
setup_circle_ci
end
desc 'Fetch certificates and provisioning profiles'
lane :certificates do
#only manage a single development cert, specifically for omni on the inside-labs branch
match(type: "development", app_identifier: "tech.insidelabs.omni.beta", git_branch: ENV["OMNI_GIT_BRANCH"], team_id: ENV["OMNI_FASTLANE_TEAM_ID"])
match(type: "adhoc", app_identifier: ENV["BETA_PACKAGE_ID"], git_branch: ENV["GIT_BRANCH"], team_id: ENV["FASTLANE_TEAM_ID"])
match(type: "appstore", app_identifier: ENV["PACKAGE_ID"], git_branch: ENV["GIT_BRANCH"], team_id: ENV["FASTLANE_TEAM_ID"])
end
desc 'Fetch certificates, build beta and upload to App Center.'
lane :beta do
certificates
gym(scheme: 'omni', workspace: './ios/omni.xcworkspace', export_method: 'ad-hoc')
appcenter_upload(
app_name: "#{ENV['IOS_APPCENTER_APP_NAME']}",
file: "#{ENV['IOS_BETA_APPCENTER_IPA_PATH']}",
destinations: "#{ENV['APPCENTER_DISTRIBUTION_GROUP']}",
destination_type: "group",
notify_testers: true,
release_notes: "#{ENV['APPCENTER_DISTRIBUTE_RELEASE_NOTES']}"
)
end
desc 'Fetch certificates, build release and upload to App Center.'
lane :master do
certificates
gym(scheme: 'omni', workspace: './ios/omni.xcworkspace', export_method: 'app-store')
upload_to_app_store(
submit_for_review: false,
automatic_release: false,
force: true, # Skip HTMl report verification
skip_metadata: true,
skip_screenshots: true,
precheck_include_in_app_purchases: false,
ipa: "#{ENV['IOS_APPCENTER_IPA_PATH']}"
)
end
end
platform :android do
desc 'Build beta and upload to App Center.'
lane :beta do
appcenter_upload(
app_name: ENV["ANDROID_APPCENTER_APP_NAME"],
file: "./android/app/build/outputs/apk/release/app-release.apk",
destinations: "Beta Testers",
destination_type: "group",
notify_testers: true
)
end
desc 'Build release and upload it to GooglePlay'
lane :master do
upload_to_play_store(
json_key: "./fastlane/google-play-key.json",
aab: "./android/app/build/outputs/bundle/release/app-release.aab",
package_name: "#{ENV['ANDROID_PACKAGE_ID']}",
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true,
track: "internal"
)
end
end
No Appfile found
fastlane gems
| Gem | Version | Update-Status |
|---|---|---|
| fastlane | 2.168.0 | 💥 Check failed |
Loaded fastlane plugins:
| Plugin | Version | Update-Status |
|---|---|---|
| fastlane-plugin-appcenter | 1.11.0 | 💥 Check failed |
Loaded gems
| Gem | Version |
|---|---|
| did_you_mean | 1.3.0 |
| slack-notifier | 2.3.2 |
| rouge | 2.0.7 |
| xcpretty | 0.3.0 |
| terminal-notifier | 2.0.0 |
| unicode-display_width | 1.7.0 |
| terminal-table | 1.8.0 |
| plist | 3.5.0 |
| public_suffix | 4.0.6 |
| addressable | 2.7.0 |
| multipart-post | 2.0.0 |
| word_wrap | 1.0.0 |
| tty-screen | 0.8.1 |
| tty-cursor | 0.7.1 |
| tty-spinner | 0.9.3 |
| colored | 1.2 |
| highline | 1.7.10 |
| commander-fastlane | 4.4.6 |
| unf_ext | 0.0.7.7 |
| unf | 0.1.4 |
| domain_name | 0.5.20190701 |
| http-cookie | 1.0.3 |
| faraday-cookie_jar | 0.0.7 |
| faraday_middleware | 1.0.0 |
| fastimage | 2.2.0 |
| gh_inspector | 1.1.3 |
| rubyzip | 2.3.0 |
| security | 0.1.3 |
| xcpretty-travis-formatter | 1.0.0 |
| dotenv | 2.7.6 |
| bundler | 2.1.4 |
| naturally | 2.2.0 |
| simctl | 1.6.8 |
| jwt | 2.2.2 |
| uber | 0.1.0 |
| declarative | 0.0.20 |
| declarative-option | 0.1.0 |
| representable | 3.0.4 |
| retriable | 3.1.2 |
| mini_mime | 1.0.2 |
| multi_json | 1.15.0 |
| signet | 0.14.0 |
| httpclient | 2.8.3 |
| google-api-client | 0.38.0 |
| nanaimo | 0.3.0 |
| colored2 | 3.1.2 |
| claide | 1.0.3 |
| CFPropertyList | 3.0.2 |
| atomos | 0.1.3 |
| xcodeproj | 1.19.0 |
| babosa | 1.0.4 |
| excon | 0.78.0 |
| ruby2_keywords | 0.0.2 |
| faraday | 1.1.0 |
| json | 2.3.1 |
| mini_magick | 4.11.0 |
| os | 1.1.1 |
| memoist | 0.16.2 |
| googleauth | 0.14.0 |
| rake | 13.0.1 |
| digest-crc | 0.6.1 |
| google-cloud-errors | 1.0.1 |
| google-cloud-env | 1.4.0 |
| google-cloud-core | 1.5.0 |
| google-cloud-storage | 1.29.1 |
| emoji_regex | 3.2.1 |
| aws-eventstream | 1.1.0 |
| aws-sigv4 | 1.2.2 |
| aws-partitions | 1.399.0 |
| jmespath | 1.4.0 |
| aws-sdk-core | 3.109.3 |
| aws-sdk-kms | 1.39.0 |
| aws-sdk-s3 | 1.85.0 |
| forwardable | 1.2.0 |
| logger | 1.3.0 |
| stringio | 0.0.2 |
| ipaddr | 1.2.2 |
| openssl | 2.1.2 |
| ostruct | 0.1.0 |
| strscan | 1.0.0 |
| date | 2.0.0 |
| fileutils | 1.1.0 |
| etc | 1.0.1 |
| io-console | 0.4.7 |
| zlib | 1.0.0 |
| libxml-ruby | 3.1.0 |
| rexml | 3.1.9 |
| psych | 3.1.0 |
| mutex_m | 0.1.0 |
| webrick | 1.4.2 |
| fastlane-plugin-appcenter | 1.11.0 |
| csv | 3.0.9 |
generated on: 2020-12-02
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 26 (3 by maintainers)
@rogerluan @autimio-brito-gaivota thanks for your valuable input guys! I am finally able to build with fastlane and circle ci for all the following xcode versions:
I tried all these 3 that previously were failing. It was fairly easy with @rogerluan instructions; Essentially and after reading the links mentioned I did the following:
In Podfile:
target 'project name' do:post_install:If someone else can verify this I’d say we can close this issue, cheers 🎉
Hello everybody!
I finally managed to solve the problem here, after two weeks of doing several tests. But I don’t know if it will be the same solution for you.
What made it work here was the following:
I compared the
podfile.lockwith the last branch that the build had worked. I verified that some libraries were with a different version with the branch that was with problem. With that, I adjustedpodfile.lockwith the versions that worked before (I believe the file had been deleted before, and that’s why those versions have been updated, possibly breaking something). What I had different was the libraries:.: To check this in an easier way, I used the tool https://editor.mergely.com/
I have added this to my Podfile:
use_flipper!({'Flipper-Folly' => '2.2.0'})I deleted the Cocoapods cache
rm -rf ~/Library/Caches/CocoaPodsI deleted the Pods folder (inside the ios folder)
rm -rf PodsI reinstalled the Pods
pod install(inside the iOS folder) ornpx pod-install(project root).: You may notice that this will adjust your
project.pbxproj.After following these steps, everything worked out here as it was before!
Xcode Version 12.4 (12D4e)
Hope this can help someone S2
@marudy we had the same issue and in our case it was because one of our libraries (mapbox) had issues with cocoapods 1.10.1. After we downgraded the installed pods version to 1.9.3, we finally were able to build.
@nodediggity just updated my original comment with the extra
certificatescommand and how we have configured it inside the fastfile. Looks like an issue hard to pass around it at the moment. Have tried quite a few things like cleaning the build, usingxcode_selectexplicitly, resolving package dependencies of swift package manager explicitly but nothing has worked out.I think if you have tried workarounds it worths mentioning them along with your provided logs. Cheers man
Hey all,
Apologies for being MIA for so long. So I took some time to investigate this issue and although I couldn’t test this issue myself (yes, I did dig into this rabbit hole of trying to install this react native thing 😭😂), I did find some answers, which I’m hoping will do the trick for you guys:
There were strong indicators that this issue was related to some type of React Native Maps library, as seen here and here (both are comments in this page). So then I dug into what that lib was, and ended up finding this issue: https://github.com/react-native-mapbox-gl/maps/issues/1097 Looks like that issue describes what you guys are seeing as well, except the user is not building via fastlane, he’s archiving and exporting manually via Xcode UI. Has anyone here tried that to see if the issue is exclusive to fastlane?
With that issue in hand, looks like this guy found a workaround 29 days ago, and then this other guy opened a Pull Request to fix the issue 16 days ago, which already got merged, but has not yet been released. Note that the fix requires changes to your Podfile regardless, see the PR description above.
Now, looks like you “just” have to consume the latest version of that pod available in master, and not the latest tag release. Stack Overflow shows how to point a pod to a specific branch.
Moreover, if you’re still facing issues, check the comments on the aforementioned PR ☝️ it mentions things related to the
use_flipper!({ 'Flipper-Folly' => '2.3.0' })as @autimio-brito-gaivota mentioned above as well. Ref.: https://github.com/react-native-mapbox-gl/maps/pull/1262#issuecomment-791588054Note that @autimio-brito-gaivota was able to get his environment fixed (described here) by downgrading that dependency to an earlier version. That might work for some as well. But some others mentioned that that wasn’t a viable alternative for them.
I hope this helps everyone. Let me know by commenting below if this worked out for you guys. If it still won’t work, try to export manually via Xcode to see if it works, please 🙏
@autimio-brito-gaivota thanks for your help man, but hard-pinning versions of my libraries is not a viable solution for me.
This is something that needs to be addressed internally from fastlane team. I really hope the guys will manage to find the time and prioritize this. @max-ott @rogerluan kindly follow up on this or let us know what is a viable way of providing an “extraction” of our pipeline ?
Thanks
@autimio-brito-gaivota Thank you very much for spending your time looking into this. I will follow your instructions on my project very soon and report back to you the results.
@NathanJozef failed for me with xcode 11.7 as well. Renamed the title to a more proper one. Thanks for your input.
I am running into the same issue here. My CircleCI instance and my own machine are both failing with this error. Am also using match and trying to sign with an adhoc profile.
I’ve followed through the conversation here. While I don’t have much to offer by way of solution at the moment I can confirm that the archived app does have a plist in the app package. Nothing in the containing archive package. What I can confirm is that building an archive from Xcode with the same profile produces a successful build.
The CircleCI instance was failing using Xcode 11.7 too. Unless it is a coincidence, this issue isn’t exclusive to Xcode 12 in all circumstances.
Captured Output
Command Used:
ios alpha --verbose --capture_outputOutput/Log
✅ fastlane environment ✅
Stack
System Locale
fastlane files:
`./fastlane/Fastfile`
`./fastlane/Appfile`
fastlane gems
Loaded fastlane plugins:
Loaded gems
generated on: 2021-02-24
I can confirm i’m getting the same error while trying to build with xcode 11.7 as well.
@rogerluan I have a huge project along with a huge pipeline on the circle ci. Can you propose a way to “extract” somehow the functionality you need if there is one? Thanks
@nodediggity thanks commenting. yes I’m using match as well and manual signing style. The error above is happening for the
match AdHocuse case. As this one is keep failing i have not moved on to thematch AppStoreone yet