Function Not Found Exception

  1. 6 months ago

    Jeff T

    9 Jan 2020 Midlands of England, Europe

    I have one customer reporting this shows up in our debug logging, from the call stack.

    Wednesday, July 17, 2019 XojoFramework$4452
    Wednesday, July 17, 2019 Unhandled exception: FunctionNotFoundException
    Wednesday, July 17, 2019 RuntimeRaiseException
    Wednesday, July 17, 2019 RuntimeRaiseFunctionNotFoundException
    Wednesday, July 17, 2019 MacStitch.Event_Open%%o<MacStitch>
    Wednesday, July 17, 2019 _Z29CocoaFinishApplicationStartupv
    Wednesday, July 17, 2019 XojoFramework$4452

    Any idea what would cause that on this ONE machine only?
    (I have several macs on several OSX versions, and have never seen this before)

  2. Anthony C

    9 Jan 2020 Testers, Xojo Pro, XDC Speakers, Third Party Store, Forum Moderators, MVP GraffitiSuite Developer

    FunctionNotFoundExceptions are exclusively returned on Soft Declares. I would start by using System.IsFunctionAvailable to ensure that the libraries and functions I'm calling in to exist, and logging that. From there it should be trivial to track down exactly what library is missing or out of date on the user's machine.

  3. Jeff T

    10 Jan 2020 Midlands of England, Europe
    Edited 6 months ago

    That would suggest this one, although its already trapped in a try...catch
    All the other soft declares I have are wrapped inside
    #if targetwindows , and this is a Mac build

       
        if theOS >= "10.12" then
          //Cocoa.Framework
          try
            declare function objc_getClass lib "Cocoa.Framework" ( name as CString ) as ptr
            dim nsWindowClass as ptr = objc_getClass( "NSWindow" )
            
            declare sub AllowTabGrouping lib "AppKit"selector "setAllowsAutomaticWindowTabbing:" ( classPtr as Ptr , enableDisable as Boolean )
            
            AllowTabGrouping( nsWindowClass, false )
          catch
          end try
          
        end if
      end if

    Maybe its INSIDE

    SystemInformationMBS.OSVersionString
  4. Anthony C

    10 Jan 2020 Testers, Xojo Pro, XDC Speakers, Third Party Store, Forum Moderators, MVP GraffitiSuite Developer

    @Jeff T Maybe its INSIDE

    That's possible. You could check by adding some debug logging to your application around that call and sending a build to that user. You could also try replacing that call with one of the solutions presented on this thread .

  5. Sam R

    10 Jan 2020 Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan

    Which version of the macOS is your customer running? allowsAutomaticWindowTabbing is available from macOS 10.12 onwards.

    Ideally you should be using respondsToSelector before calling a function that is dependent on OS version.

    Lastly, I think your Try/Catch block should look like.

    Try
    ....
    Catch err as FunctionNotFoundException
    End Try

or Sign Up to reply!