【问题标题】:Writing an Appcelerator Titanium iOS module with 3rd party Framework使用 3rd 方框架编写 Appcelerator Titanium iOS 模块
【发布时间】:2015-11-06 08:28:28
【问题描述】:

我正在尝试使用外部框架编写一个新模块。我已按照此处的说明进行操作:http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Project-section-43288810_iOSModuleProject-AddaThird-PartyFramework 关于如何添加外部框架。

模块编译。 Titanium 应用程序也可以编译。但是当在 iPhone 模拟器中应用程序崩溃时(甚至在使用模块之前)。

我在 Titnaium Studio 中收到以下错误:

[ERROR] :  An error occurred during build after 1m 19s 125ms
[ERROR] :  Detected multiple crashes:
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193036_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193042_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193122_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193354_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-064617_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072141_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072205_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072249_Ophirs-Mac-mini.crash
[ERROR] :    /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-073843_Ophirs-Mac-mini.crash
[ERROR] :  Note: these crashes may or may not be related to running your app.
TRACE  | titanium exited with exit code 1
ERROR  | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/ophir/.appcelerator/install/5.0.4/package/node_modules/appc-cli-titanium/plugins/run.js:92:66)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
TRACE  | Sending exit signal to titanium process:  19220

我检查了崩溃日志,这是我得到的:

Dyld Error Message:
  Library not loaded: @rpath/SweetAlertFramework.framework/SweetAlertFramework
  Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/6451C367-A7B7-437D-956F-57E86D8419FD/data/Containers/Bundle/Application/683ED437-B0E6-42F0-BC8E-26B2E95829CA/SweetAlertDialogTest.app/SweetAlertDialogTest
  Reason: image not found

我检查了module.xcconfig 中的路径,它是正确的。另一件看起来很奇怪的事情是崩溃日志中的路径/Users/USER/Library/Developer/CoreSimulator/Devices/6451C367-A7B7-437D-956F-57E86D8419FD/data/Containers/Bundle/Application/683ED437-B0E6-42F0-BC8E-26B2E95829CA/SweetAlertDialogTest.app/SweetAlertDialogTest,它不是我机器上的有效路径。

为什么找不到模块?

【问题讨论】:

    标签: ios objective-c titanium-mobile appcelerator-mobile titanium-modules


    【解决方案1】:

    我认为@HansKnoechel 的意思是说*.frameworkiphone/platform。这样,当模块实际捆绑时,框架也将被包含在内。您可以通过检查modules/iphone/&lt;YourModule&gt;/&lt;YourModuleVersion&gt;/platform 目录来验证框架是否在正确的位置。

    【讨论】:

    • 做到了。我按照文档的说明进行操作。我还检查了当我将模块添加到我的 Titanium 项目时,框架是否包含在内(没有它,它不会在 Appcelerator Studio 中编译)。我还检查并仔细检查了文档中提到的框架搜索路径。
    【解决方案2】:

    看起来无法引用第 3 方框架的捆绑包。确保将 *.framework 文件复制到平台/ios 中,以便编译它们。还要检查 Xcode 设置“将二进制文件与库链接”并确保它在此处列出。

    【讨论】:

    • 您好,感谢您的回答。我在哪里可以找到 *.bundle 文件。没看到这种东西……
    • 这是关于 @brianjd 更正的 .framework 文件。
    • 它就在那里 - 我按照文档页面上的说明进行操作,这是其中的一部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-22
    • 1970-01-01
    相关资源
    最近更新 更多