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

Using upload-dif results in Serde("missing field CFBundleName") #1301

Closed
artur-zaremba opened this issue Jul 27, 2022 · 25 comments · Fixed by #1310 or #1311
Closed

Using upload-dif results in Serde("missing field CFBundleName") #1301

artur-zaremba opened this issue Jul 27, 2022 · 25 comments · Fixed by #1310 or #1311

Comments

@artur-zaremba
Copy link

artur-zaremba commented Jul 27, 2022

Environment

macOS 12.4
Xcode 13.4.1, iOS app for min iOS 13
sentry-cli 2.5.0 installed via homebrew

Steps to reproduce

sentry-cli upload-dif -o ORG -p PROJECT --wait --log-level=debug ./AppName.app.dSYM.zip

Expected Result

Debug information files uploaded to Sentry.

Actual Result

error: Could not parse Info.plist file caused by: Serde("missing field CFBundleName")

@artur-zaremba
Copy link
Author

artur-zaremba commented Jul 27, 2022

Also, I have found similar but resolved issues:

#895
#845
#48
#1093
getsentry/sentry-fastlane-plugin#127

I want to use sentry plugin fastlane for uploading debug symbols via Using App Store Connect which seems more interesting for me because there is no need to wait for build processing. But I can't run the solution out of the box. Is there some workaround to use it?
https://docs.sentry.io/platforms/apple/guides/ios/dsym/#bitcode-appstore
https://docs.sentry.io/platforms/apple/guides/ios/dsym/#symbolmap-fastlane

@artur-zaremba
Copy link
Author

Seems that sentry_upload_dsym fastlane action also don't work in the same environment, I see the same error 😞

@artur-zaremba
Copy link
Author

Regarding link in Sentry https://betterprogramming.pub/info-plist-is-missing-in-xcode-13-heres-how-to-get-it-back-1a7abf3e2514 I have Info.plist in my project

@fzymek
Copy link

fzymek commented Aug 3, 2022

Hey @artur-zaremba
I've encountered the same issue when using fastlane plugin. What helped me was to copy & paste all bundle related information from the "autogenerated" Info.plist (I am using this "semi sync" approach) into the new local file. Now my "local" Info.plist file looks like this:

<?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>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundleVersion</key>
	<string>$(CURRENT_PROJECT_VERSION)</string>
	<key>CFBundleShortVersionString</key>
	<string>$(MARKETING_VERSION)</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
</dict>
</plist>

This sill feels like a workaround rather then a real solution but at least it unblocked me.

@artur-zaremba
Copy link
Author

Thanks @fzymek, seems like it doesn't work without a workaround, that is why I summarised the issue from other closed issues. Seems like Sentry devs don't see it as a problem

@kamilogorek
Copy link
Contributor

@marandaneto
Copy link
Contributor

@brustolin is working on iOS, ideas?

@brustolin
Copy link

Im not familiar with sentry-cli. I would need to investigate this a little bit.

@artur-zaremba Any minimum repro would be very helpful

@Dids
Copy link

Dids commented Aug 4, 2022

Any new Xcode project should suffice as a repro, as the issue will be there by default.
The actual Info.plist on disk won't have the usual bundle display name, version and so on, however these will still be visible in Xcode itself. The Info.plist file might also not even exist by default anymore, until you fill in some of the data in Xcode, and/or create the file and provide the path to it in Xcode.

As to potential workarounds or fixes, it would be a matter of finding and parsing the right data from the right file, which I'm assuming would be the project file, but not entirely sure as I haven't delved too deep into this recent(ish) change.

By the looks of things, Apple is trying to get rid of Info.plist entirely, which will undoubtedly break a lot of 3rd party functionality, automation etc.

@danielrobleM
Copy link

danielrobleM commented Aug 12, 2022

Hi, I have the same problem in a new project created with Xcode 13.3.1, for Min target iOS 14

What fzymek suggested did not work for me, but this did

	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundleVersion</key>
	<string>$(CURRENT_PROJECT_VERSION)</string>
	<key>CFBundleShortVersionString</key>
	<string>$(MARKETING_VERSION)</string>

Include CFBundlePackageType and CFBundleExecutable still show the error 🤔

@bruno-garcia
Copy link
Member

Sounds like the new xcode doesn't create the info.plist file containing the information we need (e.g CFBundleName).

Is the bundle name anywhere to be found? We can ask @kamilogorek for help in changing sentry-cli to parse the right file but he'll need help getting a repro. @brustolin is this something you can help out with?

@brustolin
Copy link

Sounds like the new xcode doesn't create the info.plist file containing the information we need (e.g CFBundleName).

Yes, thats true.

Is the bundle name anywhere to be found?

Yes. PROJECT_NAME.xcodeproj/project.pbxproj
contains the following line:
PRODUCT_BUNDLE_IDENTIFIER = com.sample.bundle_id;

But this line appears once for each environment (debug, release, ...). I dont see why someone would use different values but this is something to keep in mind.

@kamilogorek can you help us out to update sentry-cli?

@marandaneto
Copy link
Contributor

It's important to fall back to the old plist file if the new property isn't available, because not everyone is using the latest Xcode projects nor Hybrid SDKs such as Flutter/RN upgrades them so often.
I'd also double-check if the bundle identifier is the only one, might have to check some other ones too.

@brustolin
Copy link

It's important to fall back to the old plist file if the new property isn't available

I think the plist should be the default tbh, I believe plist have priority over the project value.

@kamilogorek
Copy link
Contributor

kamilogorek commented Aug 16, 2022

Well, funny enough I cannot repro this issue with a fresh project on the same xcode version ¯_(ツ)_/¯

PRODUCT_BUNDLE_IDENTIFIER = com.sample.bundle_id;

We already fall back to those values in some cases, but it's unclear what code path is taken in the OPs case. Would be great if I could get a repro.

@brustolin
Copy link

I also could not repro this.
@artur-zaremba can you help us providing a minimum sample?

@artur-zaremba
Copy link
Author

I have just created new project, added SPM library and added initialization code in AppDelegate.swift. Then I uploaded it to TestFlight, downloaded dSYM and tried upload it via sentry-cli upload-dif - the error is the same. I have sent you invite to the project, please check @brustolin

@brustolin
Copy link

Thanks for this. I got the same problematic behaviour. Can you add @kamilogorek too in you sample project please?

BTW, which type of new project do you use in your xCode? I created a new iOS SwiftUI from scratch and did not got the same outcome.

@artur-zaremba
Copy link
Author

Sure, I will add him.
I create iOS project with Storyboard interface.

@kamilogorek
Copy link
Contributor

Got the repro, found the issue, working on the fix

@kamilogorek
Copy link
Contributor

@artur-zaremba should be fixed in 2.5.1, would you mind giving it a try?
Thanks for helping us reproduce it.

@danielrobleM
Copy link

Hi @kamilogorek , I updated to 2.5.1.
Create a new xcode project with Xcode 13.3.1. Still the same error 😢

@kamilogorek
Copy link
Contributor

@danielrobleM can you provide a concrete repro for this? I verified using @artur-zaremba repro, which had the same bug, and it's fixed now for his case.

@kamilogorek
Copy link
Contributor

@danielrobleM your usecase should be fixed in 2.5.2

@grigorye
Copy link

grigorye commented May 27, 2023

Just in case, faced this issue with sentry-cli upload-dif apparently trying to look up something via .xcodeproj (that was kind of surprising to me - can't see it documented anywhere), even though it was handed .xcarchive with a valid Info.plist. (Btw, when .xcodeproj was not available, sentry-cli had no problem, just complained that result of xcodebuild -list -json -project is not parseable).

The workaround was to force it use Info.plist from .xcarchive itself like below:

sentry-cli upload-dif \
  --log-level debug \
  --auth-token "$SENTRY_API_TOKEN" \
  --org "$SENTRY_ORG" \
  --project "$SENTRY_PROJECT" \
  --include-sources \
  --info-plist "$ARCHIVE_PATH"/*/Applications/*.app/Contents/Info.plist \
  "$ARCHIVE_PATH"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants