element-hq / element-ios

A glossy Matrix collaboration client for iOS
https://element.io
Apache License 2.0
1.73k stars 486 forks source link

Archive generated from Xcode 15.4 is not valid for TestFLight/AppStore #7833

Open NicolasBuquet opened 1 month ago

NicolasBuquet commented 1 month ago

Steps to reproduce

Update to Xcode 15.4. (it works as intended with Xcode 15.2)

Generate Archive and Validate it in Organizer.

Outcome

What did you expect?

The archive to be ok.

What happened instead?

The archive is not validated:

Asset validation failed
Invalid MinimumOSVersion. Apps that only support 64-bit devices must specify a deployment target of 8.0 or later. MinimumOSVersion in 'Tchap.app/Frameworks/WysiwygComposerFFI.framework' is ''. (ID: 43f8032e-66cb-4bf1-abd4-0e27bf0c1b20)

Asset validation failed
Missing Info.plist value. A value for the key 'MinimumOSVersion' in bundle Tchap.app/Frameworks/WysiwygComposerFFI.framework is required. (ID: 15256840-ecf1-4219-839f-80153dd8f54a)

Asset validation failed
The bundle 'Payload/Tchap.app/Frameworks/WysiwygComposerFFI.framework' is missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString. Please find more information about CFBundleShortVersionString at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring (ID: 3ebd5a70-b915-4e99-b802-61b018f73eee)

Asset validation failed
This bundle Payload/Tchap.app/Frameworks/WysiwygComposerFFI.framework is invalid. The Info.plist file is missing the required key: CFBundleVersion. Please find more information about CFBundleVersion at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion (ID: 4f8f6b0b-ccf9-466a-be28-4655e384217d)

Asset validation failed
Invalid Bundle. The bundle Tchap.app/Frameworks/WysiwygComposerFFI.framework does not support the minimum OS Version specified in the Info.plist. (ID: 7848974c-f03a-4dec-9eb5-dbf143558fd0)

Your phone model

No response

Operating system version

No response

Application version

Element 1.11.6

Homeserver

No response

Will you send logs?

No

NicolasBuquet commented 1 month ago

It is essentially a problem Apple side.

But I think the Swift Package for matrix-wysiwyg-composer-swift missed the version informations. It could be added in the package description.

A work around is to manually edit the faulty info.plist file directly into the xcarchive generated, before uploading it to Apple.

info.plist valid file :

<?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>CFBundleExecutable</key>
    <string>WysiwygComposerFFI</string>
    <key>CFBundleIdentifier</key>
    <string>org.matrix.WysiwygComposerFFI</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundlePackageType</key>
    <string>FMWK</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>MinimumOSVersion</key>
    <string>15.0</string>
</dict>
</plist>
NicolasBuquet commented 1 month ago

@pixlwave @giomfo FYI

Tchap issue: https://github.com/tchapgouv/tchap-ios/issues/1082

pixlwave commented 1 month ago

This is known and fixed on the RTE/EX (https://github.com/matrix-org/matrix-rich-text-editor/pull/1018). The EI project doesn't support Xcode 15.4 yet, please make sure you use the Xcode version specified in the Fastfile.

Ashik55 commented 1 week ago

@NicolasBuquet Do I need to modify root info.plist file (Riot)? cause root info.plist already have all these keys defined

<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>

only MinimumOSVersion is missing here. adding MinimumOSVersion only does'nt fix the issue.

<key>MinimumOSVersion</key>
<string>15.0</string>
NicolasBuquet commented 1 week ago

@Ashik55 Normaly, the Riot info.plist is complete.

Apple validation toolchain complains for embedded frameworks only.

You only need to complete de info.plist of faulty embedded frameworks.

But modify it once the archive is generated. You explore the archive until the frameworks folder (you find the archive file with a right-click on the product in Xcode organizer), and then open the faulty framework folder, find and complete its info.plist.

You then upload the archive (via Xcode Organizer) to Apple.

Ashik55 commented 1 week ago

@NicolasBuquet Thanks, after archiving when I open archived files as show package content. There's no folder for framwork. could you please guide me where will I get the framework folder?

Screenshot 2024-09-05 at 7 19 51 PM
NicolasBuquet commented 1 week ago

@Ashik55

Look into > Product > Applications > App Bundle > Frameworks :

image

Ashik55 commented 1 week ago

@NicolasBuquet Thanks, I found the info.plist & updated as you've suggested & now I am getting this error.

Screenshot 2024-09-06 at 4 55 08 PM
Ashik55 commented 4 days ago

@NicolasBuquet any idea how can I resolve this?

NicolasBuquet commented 4 days ago

@Ashik55 Maybe your main Bundle specify a "Minimum OS Version" higher than 15.0. You have to check (directly in Xcode, in the target panel properties).

And if its différent than 15.0, specifiy the same version in your framework.