0

我正在使用Appcelerator Hyperloop,希望将调用的第三方 iOS 框架集成KolorEyes到我的Titanium应用程序中。

这是我的appc.js文件:

module.exports = {
hyperloop: {
    ios: {
        xcodebuild: {
            flags: {
                FRAMEWORK_SEARCH_PATHS: '../../src',
                LD_RUNPATH_SEARCH_PATHS: '@executable_path'
            },
            frameworks: [
                'KolorEyes'
            ]
        },
        thirdparty: {
            'KolorEyes': {
                source: ['src'],
                header: 'src',
                resource: 'src'
            }
        }
    }
}

};

我的KolorEyes.framework文件src夹位于项目根目录的文件夹中。

我正在做的事情看起来应该可行:

index.js

var KolorEyes = require('KolorEyes/KolorEyes');
var KolorEyesSessionParams = require('KolorEyes/KolorEyesSessionParams');
var KolorEyesRenderViewParams = require('KolorEyes/KolorEyesRenderViewParams');

console.log('CLASS: ' + KolorEyes);
console.log('CLASS: ' + KolorEyesSessionParams);
console.log('CLASS: ' + KolorEyesRenderViewParams);

这是输出:

[INFO] :   CLASS: [class KolorEyes]
[INFO] :   CLASS: [class KolorEyesSessionParams]
[INFO] :   CLASS: [class KolorEyesRenderViewParams]

但是当我尝试这样做时:

var params = KolorEyesSessionParams.alloc().init();

它告诉我找不到课程KolorEyesSessionParams

[ERROR] :  Cannot find class with name: KolorEyesSessionParams
[ERROR] :  Script Error {
[ERROR] :      column = 32;
[ERROR] :      description = "Cannot find class with name: KolorEyesSessionParams";
[ERROR] :      line = 108;
[ERROR] :      message = "Cannot find class with name: KolorEyesSessionParams";
[ERROR] :      name = ClassNotFound;
[ERROR] :      nativeStack = "1   libobjc.A.dylib                     0x23a6ae17 objc_exception_throw + 38\n2   kolor_test                          0x0019ce0b kolor_test + 1515019\n3   kolor_test                          0x00195d05 kolor_test + 1486085\n4   JavaScriptCore                      0x275f77cd <redacted> + 364\n5   JavaScriptCore                      0x273c7dfb <redacted> + 314\n6   JavaScriptCore                      0x273c6629 <redacted> + 120\n7   JavaScriptCore                      0x2768302f <redacted> + 20366\n8   JavaScriptCore                      0x27683039 <redacted> + 20376\n9   JavaScriptCore                      0x2767de91 <redacted> + 336\n10  JavaScriptCore                      0x275d87db <redacted> + 102\n11  JavaScriptCore                      0x273caa09 <redacted> + 344\n12  JavaScriptCore                      0x273ca8ad _ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE + 52\n13  JavaScriptCore                      0x275887a3 <redacted> + 126\n14  JavaScriptCore                      0x276dc183 _ZNK3JSC12PropertySlot14functionGetterEPNS_9ExecStateE + 42\n15  JavaScriptCore                      0x273c220b <redacted> + 1406\n16  JavaScriptCore                      0x276804ed <redacted> + 9292\n17  JavaScriptCore                      0x27683039 <redacted> + 20376\n18  JavaScriptCore                      0x27683135 <redacted> + 20628\n19  JavaScriptCore                      0x27683039 <redacted> + 20376\n20  JavaScriptCore                      0x2767de91 <redacted> + 336\n21  JavaScriptCore                      0x275d87db <redacted> + 102\n22  JavaScriptCore                      0x273b8d0d <redacted> + 7292\n23  JavaScriptCore                      0x274c839b _ZN3JSC8evaluateEPNS_9ExecStateERKNS_10SourceCodeENS_7JSValueERN3WTF8NakedPtrINS_9ExceptionEEE + 354\n24  JavaScriptCore                      0x275f6ba5 JSEvaluateScript + 268\n25  kolor_test                          0x0003c91d kolor_test + 71965\n26  kolor_test                          0x00042fa7 kolor_test + 98215\n27  kolor_test                          0x00044741 kolor_test + 104257\n28  kolor_test                          0x00044b81 kolor_test + 105345\n29  kolor_test                          0x0003caf3 kolor_test + 72435\n30  kolor_test                          0x0003da83 kolor_test + 76419\n31  kolor_test                          0x00045589 kolor_test + 107913\n32  kolor_test                          0x00044521 kolor_test + 103713\n33  libdispatch.dylib                   0x23e3d823 <redacted> + 10\n34  libdispatch.dylib                   0x23e3d80f <redacted> + 22\n35  libdispatch.dylib                   0x23e4bba9 <redacted> + 1524\n36  CoreFoundation                      0x24291b6d <redacted> + 8\n37  CoreFoundation                      0x24290067 <redacted> + 1574\n38  CoreFoundation                      0x241df229 CFRunLoopRunSpecific + 520\n39  CoreFoundation                      0x241df015 CFRunLoopRunInMode + 108\n40  GraphicsServices                    0x257cfac9 GSEventRunModal + 160\n41  UIKit                               0x288b3189 UIApplicationMain + 144\n42  kolor_test                          0x00030747 kolor_test + 22343\n43  libdyld.dylib                       0x23e87873 <redacted> + 2";
[ERROR] :      sourceURL = "file:///var/containers/Bundle/Application/1536D545-76AB-48FA-BDF7-C2729A175F82/kolor_test.app/hyperloop/koloreyes/koloreyessessionparams.js";
[ERROR] :  }

我使用东西没有问题UIKit,但只是看不到这些第三方类。即使Hyperloop说它正在为他们生成课程:

[INFO] :   [Hyperloop] Generating class GLKit/GLKView
[INFO] :   [Hyperloop] Generating class GLKit/GLKViewController
[INFO] :   [Hyperloop] Generating class KolorEyes/KolorEyes
[INFO] :   [Hyperloop] Generating class KolorEyes/KolorEyesRenderViewParams
[INFO] :   [Hyperloop] Generating class KolorEyes/KolorEyesSessionParams
[INFO] :   [Hyperloop] Generating class ModelIO/MDLCamera
[INFO] :   [Hyperloop] Generating class ModelIO/MDLLight

有任何想法吗?

4

1 回答 1

0

我有同样的问题。根据这个回复,问题是在平台上使用框架的时间早于创建框架的目的。

可以确认,一旦我使用旧版本的 SDK 重建了框架(需要针对 iOS 12 而不是 iOS 13 构建),这个问题就为我解决了。

这是一个普遍问题,您无法在旧设备上运行特定于版本的代码。将移动并重命名它,感谢您的报告!

Jan Vennemann 这就是我们几天前讨论的内容。我对此还没有最终计划,但是由于引用仅在特定版本和更高版本中可用的 iOS 框架(不是实际的 API)时发生错误(在这种情况下:“Speech.framework”,iOS 10+) ,如果它们的版本高于默认版本(例如,在我们的例子中为 8.1),我们可以通过使用它们的 iOS 版本保护框架来解决这个问题。

我什至可以想到一个解决方法:如果我们通过 appc.js 传递链接框架,我们也可以传递链接器标志,所以可能像我在我的 ARKit 模块中所做的那样。顺便说一句,这最终也可能是与模块相关的问题,因为我们不再需要 module.xcconfig 并且框架会自动链接。如果我们能确保将它们传递给正确的架构和版本,我们应该没问题!

资源:

https://jira.appcelerator.org/browse/TIMOB-25440?focusedCommentId=429553&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-429553

于 2020-11-11T19:20:37.533 回答