airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
203 stars 11 forks source link

adt package: iOS .ipa with dynamic frameworks fails to sign when assets with Info.plist files are included (storyboards etc) #144

Open RikAzerion opened 4 years ago

RikAzerion commented 4 years ago

Copy of: https://tracker.adobe.com/#/view/AIR-4198883. Thanks folks!

AIR 32.0.0&33.0.2, iOS 10.2.1 (did not test others).

I've created a Swift dynamic framework and have included it in a Native Extension as described in https://www.adobe.com/devnet/air/articles/swift-based-ane-for-ios-tvos.html. I've also built an ipa (iOS app) following these instructions. When I use adt package to package the .ipa with the ANE and install it on a device, the app installs and launches.This only works when I include the proper .dylib files and an unsigned version of the dynamic swift framework, as the guide instructs.

After this, I also added a static framework to the ANE, this framework contains some storyboards, which have to be copied to the root directory of an .ipa when packaged by adt package. To make this happen, I copied the storyboard folders to the root of the ANE (from ANE/iPhone-ARM/Frameworks/myframework/xxx.storyboardc to ANE/iPhone-ARM/xxx.storyboardc/).

The ANE and ipa seemingly build without problems, however when I try to install the app on a device, I get the following error:

ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008019: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.NtrnEz/extracted/Payload/AirExample.app/Frameworks/MyDynamicFramework.framework : 0xe8008019 (The application does not have a valid signature.)

I've found the following after testing:

This indicates to me that:

  1. Im including the dynamic framework correctly in both ANE and app (unsigned framework in /Frameworks dir).
  2. My static framework and its storyboards also work fine, and Im packaging the storyboards in the right way.
  3. When I add both the dynamic and static framework, I only have a problem if I package the storyboard folders in the app root. So adt package appears to have problems when building ipa's with ANE's that contain both dynamic frameworks and assets like storyboards.

I've investigated further, it's actually only the Info.plist file included in each storyboard folder that causes problems. When a storyboard folder is packaged to the ipa root without its Info.plist file (so only the .nib files), the app builds fine, but crashes when it tries to load the storyboard (it apparently needs the Info.plist).

Conclusion: When using adt package to create an .ipa and including dynamic frameworks via ANE's, it is impossible to include assets that have Info.plist files, such as storyboards. In such cases, adt package does not appear to sign the ipa correctly, and the app cannot be installed to device.

I've tried some workarounds, such as including the storyboards in the app (as resources) rather than in the ANE, same result. Any help would be greatly appreciated!

rozd commented 4 years ago

I have same issue https://github.com/Gamua/Adobe-Runtime-Support/issues/106 though a workaround described by tuarua worked for me https://github.com/Gamua/Adobe-Runtime-Support/issues/106#issuecomment-531582517

ajwfrost commented 3 years ago

@RikAzerion I just came across this old issue, and wondered whether it's still a problem if you try with the latest version of the AIR SDK? We've made a lot of changes around code-signing but I don't recollect anything about the use of Info.plis files from included storyboards..

If this is still a failure, we can look into it..

thanks

ajwfrost commented 3 years ago

.... having said that: I just then found https://github.com/airsdk/Adobe-Runtime-Support/issues/376#issuecomment-658777990 which implies we did find and fix this! Please let us know :-)