pdfium-binaries icon indicating copy to clipboard operation
pdfium-binaries copied to clipboard

Problem releasing iOS-App to App Store

Open s-beltz opened this issue 1 year ago • 5 comments

We use bblanchon.PDFium.iOS in our app. We were able to deliver our app to the App Store a couple of weeks earlier. Now when we try to build a new version of our app we run into the following error message when trying to push the *.ipa-package to the store:

Asset validation failed (90171) Invalid bundle structure. The “Apliconus.InfieldClassicMauiApp.app/libpdfium.dylib” 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 (ID: fafe60c1-a69b-4fbc-9812-3e97add8905a)

Unfortunately we do not know why this stopped working. Do you know if there has been a change in the Nuget-package that requires us to handle things differently?

Any help would be highly appreciated.

s-beltz avatar Nov 22 '24 13:11 s-beltz

We are having the same issue when using the PDFtoImage library (https://github.com/sungaila/PDFtoImage)

NcaDev1 avatar Dec 09 '24 10:12 NcaDev1

To release to the App Store I had to wrap the library as a Framework.

  1. Create a folder called pdfium.framework
  2. Copy the dylib into the folder and rename it to pdfium
  3. Change the install name install_name_tool -id @rpath/pdfium.framework/pdfium pdfium.framework/pdfium
  4. You can check that the install name was set correctly with otool -L pdfium.framework/pdfium
  5. Create an Info.plist in the pdfium.framework. I just copied one from another framework and modified the values as necessary. You can use otool -l pdfium.framework/pdfium to get info about the minimum OS version ,etc.
  6. Sign the framework: codesign --force --deep --sign - pdfium.framework

Now you should be able to use the framework as any other iOS framework.

More information here:

https://stackoverflow.com/questions/53818772/embedding-a-dylib-inside-a-framework-for-ios

https://stackoverflow.com/questions/78706187/how-to-use-ios-framework-files-in-net-8-0-maui

torfluor avatar Apr 10 '25 10:04 torfluor

It would be great if the the iOS dylib would come prepacked as a framework. I would take care to include them into the NuGet package.

Otherwise, a static lib would help, too. But I have no idea how easy it would be to build that.

sungaila avatar Nov 11 '25 17:11 sungaila

Don't I need a certificate to codesign?

bblanchon avatar Nov 12 '25 07:11 bblanchon

Don't I need a certificate to codesign?

I am not sure. I have seen unsigned frameworks, in these cases the developer will have to sign these themselves before submitting to the Apple Store.

Maybe some iOS/macOS developer can comment on this. Maybe @torfluor?

sungaila avatar Nov 12 '25 07:11 sungaila