我一直在开发一个用于编辑照片的应用程序,我想为照片应用程序添加一个扩展程序。扩展在模拟器上完美运行,没有任何问题。
但是当我尝试在我的 iPhone 6 上运行它时,我遇到了 2 个问题:
- 配置文件的问题。我知道对于扩展我需要一个新的 AppID(名为 app.myapp.com.extension,主 AppID 是 app.myapp.com)和新的配置文件。我已经使用新的 AppID 创建了 2 个新的供应 prifle(一个用于开发,另一个用于分发),但是当我尝试在设备上运行它时出现此错误:
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's. Embedded Binary Signing Certificate: - (Ad Hoc Code Signed) Parent App Signing Certificate: iPhone Developer: Mauro Vime (------------------)
我已经重新生成了开发配置文件来检查它是用于开发而不是用于 Ad Hoc,但我仍然遇到同样的问题。
- 所以我尝试从应用程序导出 ipa 并运行它。该应用程序运行完美,但扩展程序只显示黑色 View ,而不是包含照片的我的 View 。然后我查看了手机的崩溃日志,看到了这个:
Incident Identifier: 9E578D78-FAB7-419E-AB35-7BA7B0821AFA CrashReporter Key: ae6bdea47a4e64b09a8fb7fa8599b5e23ceb5311 Hardware Model: iPhone7,2 Process: extension [2598] Path:
/private/var/mobile/Containers/Bundle/Application/----------/------------/PlugIns/extension.appex/extension Identifier: app.myapp.com.extension Version: 1 (1.0) Code Type: ARM-64 (Native) Parent Process:
launchd [1] Date/Time: 2014-10-14 01:29:21.482 +0200 Launch Time: 2014-10-14 01:29:16.170 +0200 OS Version: iOS 8.1 (12B407) Report Version: 105 Exception Type: EXC_CRASH (SIGABRT) Exception Subtype: LAUNCH_HANG Exception Message: The extension took too much time to initialize Highlighted Thread: 0 Backtrace not available Unknown thread crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000 x8: 0x0000000000000000 x9: 0x0000000000000000 x10: 0x0000000000000000 x11: 0x0000000000000000 x12: 0x0000000000000000 x13: 0x0000000000000000 x14: 0x0000000000000000 x15: 0x0000000000000000 x16: 0x0000000000000000 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000 x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x0000000000000000 fp: 0x0000000000000000 lr: 0x0000000000000000 sp: 0x000000016fdb3b68 pc: 0x00000001200f9000 cpsr: 0x00000000 Binary Images: 0x1200f8000 - 0x12011ffff dyld arm64 /usr/lib/dyld
这里说该应用程序在 8.1 设备上运行,但我也在 8.0.2 iOS 上尝试过,但出现了同样的问题。在看到消息:“扩展程序初始化时间过长”后,我只是清除了 viewDidLoad 和 viewWillAppear 函数,因此它们不执行任何代码,但问题仍然存在。
有没有人遇到过这个问题并有解决方案?
最佳答案
会不会是您没有使用 64 位架构(扩展需要)?请参阅 Apple 的 App Extension Programming Guide 中的“关于 64 位架构的注意事项” .
关于ios8 照片编辑扩展问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26363446/