-1

我已经编译了带有外部 Obj-C 依赖项的 ANE 插件:

<platform xmlns="http://ns.adobe.com/air/extension/18.0">
    <description>iPhone platform description</description>
    <sdkVersion>8.4</sdkVersion>
    <linkerOptions>
        <option>-ios_version_min 7.0</option>
        <option>-framework Foundation</option>
        <option>-weak_framework AdSupport</option>
        <option>-framework AVFoundation</option>
        <option>-framework AudioToolbox</option>
        <!--option>-framework CoreTelefony</option-->
        <option>-framework CoreGraphics</option>
        <option>-framework EventKit</option>
        <option>-framework EventKitUI</option>
        <option>-framework MessageUI</option>
        <option>-weak_framework StoreKit</option>
        <option>-framework SystemConfiguration</option>
        <option>-framework CoreLocation</option>
        <option>-framework UIKit</option>
        <option>-framework Social</option>
        <option>-framework WebKit</option>
        <option>-framework CoreMedia</option>
        <option>-framework MediaPlayer</option>
        <option>-framework QuartzCore</option>
        <option>-framework CoreImage</option>
        <option>-framework CoreFoundation</option>
        <option>-framework CFNetwork</option>
        <option>-lc++</option>
        <option>-lz</option>
        <option>-lsqlite3</option>
        <option>-lxml2.2</option>
    </linkerOptions>
    <packagedDependencies>
        <packagedDependency>MyStatic.framework</packagedDependency>
    </packagedDependencies>
</platform>

ANE 插件编译无异常。当我尝试在 iOS 模拟器上运行示例 AIR 应用程序时,我得到了这个:

$> adt -installApp -platform ios -platformsdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -device ios-simulator -package out/production/sample/Sample.ipa

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: MCMMetadataIdentifier)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff8c9f703c __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x00007fff8c44776e objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8c8ddc66 -[__NSDictionaryM setObject:forKey:] + 1174
3   isb                                 0x00000001021f8433 -[iPhoneSimulator createMetaDataPList:withID:] + 314
4   isb                                 0x00000001021f8bff -[iPhoneSimulator installApp:sdkRoot:] + 742
5   isb                                 0x00000001021f9b40 -[iPhoneSimulator runWithArgc:argv:] + 1275
6   isb                                 0x00000001021f9e35 main + 101
7   libdyld.dylib                       0x00007fff941485c9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
/var/folders/7y/7xytqjbx5wggzc246fwrv1zm0000gq/T/cmd6670868742567092003.tmp: line 1: 19356 Abort trap: 6
        "/Users/ewgenius/Documents/flex_sdk_4.6/lib/aot/bin/isb/isb" "-install" "-apppath" "/var/folders/7y/7xytqjbx5wggzc246fwrv1zm0000gq/T/7239e3f7-d560-4f18-8d66-674f841b4a0f/Payload/Sample.app" "-sdkpath" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk"

但是,当我在没有 MyStatic.framework 及其依赖项的情况下编译 ANE 插件时,示例应用程序运行良好。有任何想法吗?

4

1 回答 1

0

我找到了解决方案。打包的依赖项 MyStatic.framework有 Resources 文件夹,我将整个文件夹复制到iosbuild command 目录adt package -target ane -platform iPhone-ARM -C ios/ . -platformoptions ../build/platformios.xml。当我将所有文件从 移动ios/Resources到 时,ios/我能够毫无例外地运行我的应用程序。

于 2015-09-01T09:41:41.820 回答