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

Apple Privacy Manifest Error after 2.2.0 #1656

Closed
Bilonik opened this issue May 2, 2024 · 23 comments · Fixed by #1658
Closed

Apple Privacy Manifest Error after 2.2.0 #1656

Bilonik opened this issue May 2, 2024 · 23 comments · Fixed by #1658

Comments

@Bilonik
Copy link

Bilonik commented May 2, 2024

What happened?

HI @nirinchev and @nielsenko

This was release with update 2.2.0 but its failing when uploading to the app store with this error:

Invalid bundle structure. The “Runner.app/Frameworks/realm.framework/realm_privacy.bundle/realm_privacy” binary file is not permitted. Your app cannot contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. For details, visit: https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle

Repro steps

Upload to App Store Connect

Version

2.2.0

What Atlas Services are you using?

Atlas Device Sync

What type of application is this?

Flutter Application

Client OS and version

ios

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

Copy link

sync-by-unito bot commented May 2, 2024

➤ PM Bot commented:

Jira ticket: RDART-1016

@nielsenko
Copy link
Contributor

Could you open the ios/Runner.xcworkspace in xcode and check how Mach-O type looks for realm-realm_privacy target?

image

@rouuuge
Copy link

rouuuge commented May 2, 2024

i have the same problem. The Mach-O Type looks the same like the screenshot above

@nielsenko
Copy link
Contributor

@rouuuge and @Bilonik My good colleague @nirinchev has found the culprit. If you open the actual realm_privacy.bundle you will find:
image
That exe file should no be there. Stay tuned

@nielsenko nielsenko assigned nirinchev and unassigned nielsenko May 2, 2024
@rouuuge
Copy link

rouuuge commented May 2, 2024

thank you!

@nirinchev
Copy link
Member

nirinchev commented May 2, 2024

Hey folks, I think we have a fix for this, but would appreciate if you can verify it before we cut a release. Can you download these packages: https://static.realm.io/downloads/dart/2.2.0-7ff9130187a186a7cd9b90e0375a00d371ebacd6/packages.tar.gz and replace your realm dependency in your pubspec with a path one like this:

dependencies
  realm:
    path: ../realm

(assuming the packages are located a folder above your app's pubspec.yaml). The packages are identical to what's released in 2.2.0, with minor modifications of the podspec to try and place the privacy manifest in the correct resource location rather than in a resource bundle.

When I tried it with the default flutter app, I was able to archive a bundle and validate it using xcode and I manually verified that the locations of the xcprivacy manifests are correct based on apple's docs. Then again, we've experienced a lot of edge cases with the way Apple does privacy manifest validation, so wouldn't be surprised if something else breaks.

@rouuuge
Copy link

rouuuge commented May 2, 2024

Seems to work!

@nirinchev
Copy link
Member

Great, we'll double check that the approach is the correct one with our iOS engineers but expect to have a hotfix for this by the end of the week.

@Bilonik
Copy link
Author

Bilonik commented May 2, 2024

@nirinchev i am getting this error, when using the package with the workaround fix.

Simulator Screenshot - iPhone 15 Pro Max - 2024-05-02 at 11 21 39

@nirinchev
Copy link
Member

Can you try running flutter clean?

@rouuuge
Copy link

rouuuge commented May 2, 2024

oh same here 🤦🏽‍♂️
sorry i just checked the upload to testflight

@nielsenko
Copy link
Contributor

@Bilonik & @rouuuge This concept of creating staging packages is a bit rough in the edges still.

Can I ask you to add pubspec_overrides.yaml file to your project, that looks like this:

dependency_overrides:
  realm_common:
    path: ../realm_common
  realm_dart:
    path: ../realm_dart
  realm_generator:
    path: ../realm_generator
  realm:
    path: ../realm

Assuming that matches the location of the downloaded packages relative to your project.

Then run:

dart run realm install -t macos # or what platform you are using
flutter clean
flutter run -d macos

@nielsenko
Copy link
Contributor

Also, there is another fix inbound for this. Setting resouces directly in the podspec does not play well with other pods.

@Bilonik
Copy link
Author

Bilonik commented May 2, 2024

Hi @nielsenko and @rouuuge

I made this change #1657 locally and it worked.

@nielsenko
Copy link
Contributor

@Bilonik Good to hear, and that I would expect as well. However, setting resources directly as opposed to adding a resource_bundle is not recommend due to potential conflicts (see the Podspec Syntax Reference). Though, as long as you don't have other pods conflicting on resources you should be fine.

@Bilonik
Copy link
Author

Bilonik commented May 2, 2024

Hi @nielsenko

i can confirm with this new PR #1658 everything works good.

Thanks

@nielsenko
Copy link
Contributor

@Bilonik and @rouuuge

If you have time for it, could I ask you to download and test the packages here https://static.realm.io/downloads/dart/2.2.0-7e968e330ab7a76bbd5c76a9b28c4013ec1cb3c2/packages.tar.gz.

Same procedure as above.

@rouuuge
Copy link

rouuuge commented May 2, 2024

done! can confirm that it works now

@stevenosse
Copy link

Hi
I'm still having the issue with realm 2.2.1

@nirinchev
Copy link
Member

What issue are you having?

@stevenosse
Copy link

Hi

Here is the error i'm getting after uploading the build on AppstoreConnect

ITMS-90288: Invalid Code Signing Entitlements - The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '' for the key 'com.apple.application-identifier' in 'Paper.app/Contents/Frameworks/librealm_dart.dylib'

ITMS-90286: Invalid Code Signing Entitlements - Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, value '' for key 'com.apple.application-identifier' in 'Paper.app/Contents/Frameworks/librealm_dart.dylib' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier .

Apple Developer Relations

Realm version: realm: ^2.2.1

Pubspec.lock
Capture d’écran 2024-05-22 à 09 26 07

@nielsenko
Copy link
Contributor

@stevenosse This is not the same issue as this, but instead #1679

@stevenosse
Copy link

Yes, my apologies, I should have been more careful.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants