添加XSuperObject时项目无法在iOS中启动 [英] Projects fail to start in iOS when adding XSuperObject

查看:102
本文介绍了添加XSuperObject时项目无法在iOS中启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将其直接报告给X-SuperObject项目 ,但我认为我可能会在堆栈溢出方面获得更多质量帮助.

I've already reported this directly to the X-SuperObject project, but I thought I may get more quality help on Stack Overflow.

使用Delphi XE8,我在iOS Simulator(7.1、8.1、8.2和8.3)上使用XSuperObject时遇到问题.因此,我启动了一个空的Firemonkey应用程序,开始添加了先前项目中的某些内容(此时我不知道问题出在哪里).一切正常,直到我将最新的XSuperObject和XSuperJSON单元添加到我的应用中为止.

Using Delphi XE8, I have issues using XSuperObject on iOS Simulator (7.1, 8.1, 8.2 and 8.3). So I started an empty Firemonkey app, started adding some things which were in my prior project (at this point I didn't know what the issue was). All worked fine up until I added the latest XSuperObject and XSuperJSON units to my app.

uses
  XSuperObject, XSuperJSON;

在iOS模拟器中运行时,出现异常:

Upon running in the iOS simulator, I get an exception:

Project dyld_sim raised exception class EOSError with message 'System Error. Code: 2. No such file or directory.

除了添加单元(XSuperObject,XSuperJSON)和一些基本控件(面板,按钮和组合框)之外,我没有任何代码,也没有进行任何更改.

I have no code, and have made no changes other than adding units (XSuperObject, XSuperJSON) and a few basic controls (Panel, Button, and Combo Box).

我休息时需要带我去

System.SysUtils.RaiseLastOSError-最后一行raise Error;

...这只是引发实际异常本身的地方,无关紧要.

...which is just the spot where the actual exception itself was raised, nothing of relevance.

因此,我打开了主项目文件,并在第一行Application.Initialize;上放置了一个断点,但是从未达到该断点.我还在XSuperObject和XSuperJSON的初始化"中都添加了断点,但它们都没有停止.

So I opened the main project file and put a break point right on the first line Application.Initialize; but that break point is never reached. I also put breakpoints in the "initialization" of both XSuperObject and XSuperJSON and neither of them stop either.

一旦我移除了两个单元,一切都会恢复正常.

Once I removed both units, everything worked again.

这里出了什么问题,我该如何解决?

What's going wrong here and how do I fix it?

  • X-SuperObject版本:在报告之前从此处撤消更新
  • Delphi XE8版本22.0.19027.8951(无更新)
  • IDE操作系统:Windows 7 SP1(版本6.1,内部版本7601,64位)
  • Mac OS:OS-X 10.10.3
  • 目标操作系统:iOS模拟器-iPad Air/iOS 8.2(12D508)
  • X-SuperObject Version: Pulled update from here just prior to reporting
  • Delphi XE8 Version 22.0.19027.8951 (No Updates)
  • IDE OS: Windows 7 SP1 (Version 6.1, Build 7601, 64bit)
  • Mac OS: OS-X 10.10.3
  • Target OS: iOS Simulator - iPad Air / iOS 8.2 (12D508)

注意:以上版本详细信息仅是一个特定示例,但我无法使其在任何iOS设备/版本上正常工作.

NOTE: Above version details are just one specific example, but I cannot get it to work on any iOS device/version.

更新:调试完系统(第115个单元的初始化)后,我开始了解引发异常的地方.在System.RegularExpressionsCore 680行上...

UPDATE: After debugging the system (the 115th unit initialization), I came to learn the point where the exception is raised. In System.RegularExpressionsCoreon line 680...

{$IFDEF DYNAMIC_LIB}
class constructor TPerlRegEx.Create;
begin
  if not LoadPCRELib then
    RaiseLastOSError; //<-- Exception raised here
end;
{$ENDIF DYNAMIC_LIB}

LoadPCRELib ...

{$IFDEF DYNAMIC_LIB}
function LoadPCRELib: Boolean;

  function GetProcAddr(const ProcName: MarshaledAString): Pointer;
  begin
    dlerror;
    Result := dlsym(_PCRELib, ProcName);
  end;

  procedure SetCallback(const cbName: MarshaledAString; ProcPointer: Pointer);
  begin
    Pointer(GetProcAddr(cbName)^) := ProcPointer;
  end;

begin
  Result := True;
  if _PCRELib = 0 then
  begin
    Result := False;
    _PCRELib := HMODULE(dlopen(PCRELib, RTLD_LAZY)); //<-- Returns 0 (no handle)
    if _PCRELib <> 0 then
    begin
      // Setup the function pointers
      ...
      Result := True;
    end;
  end;
end;
{$ENDIF}

仅使用此单元运行项目时,它运行得很好.

While running a project using only this unit, it runs just fine though.

因此,似乎只有当我使用X-SuperObject时,才能找到/usr/lib/libpcre.dylib.

So it seems to be unable to find /usr/lib/libpcre.dylib, but only if I'm using X-SuperObject.

我已经更新了所有环境,包括Delphi IDE中的OS-X,XCode,iOS Simulator和SDK链接(全部删除并重新创建).我已经验证了SDK和iOS版本完全匹配.但是问题仍然存在.

I've updated all of my environment, including OS-X, XCode, iOS Simulator, and SDK links in Delphi IDE (Deleted all and recreated them). I've verified the SDK and iOS versions all match perfectly. But the problem still persists.

推荐答案

请安装 iOS 8模拟器修补程序,那么它应该可以正常工作.

Please install the iOS 8 Simulator Hotfix, then it should work fine.

这篇关于添加XSuperObject时项目无法在iOS中启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆