zkmopro / mopro

Making client-side proving on mobile simple.
https://zkmopro.org
Apache License 2.0
131 stars 35 forks source link

Dylib Framework not accepted by App Store #107

Closed oskarth closed 5 months ago

oskarth commented 8 months ago

Problem

When submitting example app to app store we get the following error:

We noticed one or more issues with a recent delivery for the following app:

MoproExampleApp
Version 1.0
Build 1
Please correct the following issues and upload a new binary to App Store Connect.

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

Apple Developer Relations

This only happens when you do app submission, not when building the app locally.

Details

Brain dump of relevant things.

See https://github.com/oskarth/mopro/pull/106 for latest PR. This is the circuit dylib in an XCFramework and then embedded in app. https://github.com/oskarth/mopro/blob/main/scripts/cli/build_ios.sh#L198-L217

Dylib support https://github.com/oskarth/mopro/issues/11 issue.

We load circuit by path, so we need dylib path. If we naively convert to framework binary format with lipo it doesn't seem to be able to read. Problem doesn't mention dylib, but when removing it it works.

Some relevant links:

https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle

Avoid using dynamic library files (.dylib files) for dynamic linking. An XCFramework can include dynamic library files, but only macOS supports these libraries for dynamic linking. Dynamic linking on iOS, watchOS, and tvOS requires the XCFramework to contain .framework bundles.

https://forums.swift.org/t/swift-package-with-dynamic-libraries-leads-to-app-store-validation-error/66857/12

Acceptance criteria

Successful submission to TestFlight/App store with circuit as dylib embedded.

Alt: Some other way of doing witness generation (see other issues)

oskarth commented 8 months ago

Notes:

圖片


To try (from Phil):

https://medium.com/trueengineering/xcode-and-xcframeworks-new-format-of-packing-frameworks-ca15db2381d3

圖片

The main thing that is different is construction of framework inside of xcframework.

0xturboblitz commented 8 months ago

Here is where I am right now. Currently I'm working on my repo, which has a bit of a different structure, but not that different. Latest changes on this branch. I will try to work on a mopro branch in the future for easier collaboration.

Now that I'm putting the .dylib file in a framework, I'm not getting the previous error anymore:

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

But now getting this one by email on submitting for Test Flight:

ITMS-90868: Missing Bundle Executable - You must include a valid CFBundleExecutable key in your bundle's information property list file for bundle 'ProofOfPassport.app/Frameworks/proofofpassport.framework'.

In both cases, the Archive and Validation step work, I only get this error by email after uploading to the Apple's servers. This is the case both when I include proofofpassport.dylib and when I turn it into a binary by removing the .dylib extension as some answers suggest. I tried multiple combinations of changing the CFBundleExecutable value and adapting code but I can't get past this step. If you are stuck before all of that feel free to contact me, you might have an error I encountered.

chirag05k commented 8 months ago

We encountered the same error last week and successfully resolved it.

However, when we face the "Swift" folder missing error, Xcode crashes, preventing us from uploading the build to the App Store.

Here's what we tried:

We attempted various resolutions, but none of them proved effective.

Ultimately, we removed our account access from the App Store, added another email to the App Store, and attempted the upload using that account in Xcode. This approach worked smoothly for us.

0xturboblitz commented 8 months ago

Here is the latest PR in which I get a different error when manually constructing a framework: https://github.com/oskarth/mopro/pull/122

oskarth commented 7 months ago

Related: https://github.com/oskarth/mopro/pull/127