Search code examples
iosxcodeimessageimessage-extensionios-stickers

This bundle is invalid - The Info.plist file for /Payload/MyAppName.app/Sticker Pack.stickerpack is missing or could not be read


Hope you are well. I want to add iMessage Stickers to my app. My app created in Android Studio using LibGDX/RoboVM. So, I can't add Stickers extension directly to my project. I have signed .ipa as output from Android Studio after building with RoboVM. I have created a single standalone project in Xcode with my app's bundle id, added the Stickers extension, then have done the following.

In the terminal

  1. Unzipped the .ipa using "unzip MyApp.ipa".
  2. Removed the _CodeSignature folder using "rm -rf Payload/MyApp.app/_CodeSignature/"
  3. Copied and Pasted the Stickers extension to the "Payload/MyApp.app/"
  4. Copied and Pasted the provisioning profile using "cp MyDistributionProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision"
  5. Signed again using "codesign -f -s "iPhone Distribution: MyCompany INC" --entitlements Entitlements.plist Payload/MyApp.app"
  6. Zipped using "zip -qr MyResignedApp.ipa Payload/".

After this, I tried to upload the MyResignedApp.ipa via ApplcationLoader from XCode and did not get any error during upload.

The problem is that I received the rejection email, where they said the following,

This bundle is invalid - The Info.plist file for /Payload/MyApp.app/Sticker Pack.stickerpack is missing or could not be read.

The Info.plist exists and here is it.

<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>new_stickers</string>
<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>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.message-payload-provider</string>
    <key>NSExtensionPrincipalClass</key>
    <string>StickerBrowserViewController</string>
</dict>

Any suggestions what I'm doing wrong? Many Many thanks.


Solution

  • You `Copied and Pasted the Stickers extension to the "Payload/MyApp.app/" but extension has to be located in "Payload/MyApp.app/PlugIns".

    MobiVM natively supports packing and signing extension out of the box. And it is not required to manual repacking/signing.

    But you have to build app extension in Xcode within standalone project, then reference extension in robovm.xml like bellow:

     <appExtensions>
         <extension profile="3AED05A9-5F1F-4120-9276-11980B9C88EE">OneSignalNotificationServiceExtension</extension>
     </appExtensions>
    

    To build it in Xcode easies way is to add extension target to empty project. Then build it separately from command line using xcode-build:

    xcodebuild -project onesignal.xcodeproj -target OneSignalNotificationServiceExtension -configuration release -sdk iphoneos -arch arm64 -arch armv7 -arch armv7s BUILD_DIR=build BUILD_ROOT=build
    xcodebuild -project onesignal.xcodeproj -target OneSignalNotificationServiceExtension -configuration release -sdk iphonesimulator -arch i386 -arch x86_64 BUILD_DIR=build BUILD_ROOT=build
    

    and pack into fat binary using lipo.

    lipo -create -output "OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension" \
        "build/release-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension" \
        "build/release-iphonesimulator/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension"
    

    Also in case of stickers extension RoboVM copies following to IPA:

    • MessagesApplicationExtensionSupport/MessagesApplicationExtensionStub
    • MessagesApplicationSupport/MessagesApplicationStub

    Which might be missing when you do repacking manually.

    There is a tutorial for MobiVM how to use app extension which provide more details about each step.