Kaju admin app crashing

  1. 5 months ago

    Walter P

    Feb 2 Testers, Xojo Pro
    Edited 5 months ago

    I'm working through the Read Me to integrate Kaju and step 3 of the Step By Step guide is failing.

    Run the Kaju Admin app through the included project and save a new document with an appropriate name, something like "MyApp v.1.kaju". You don't have to add any updates at this time.

    That doesn't work; I can't save a new document; the app crashes with an UnsupportedFormatException in this section of code:

    Function Resolve() As FolderItem
      if zSaveInfo.LenB = 0 then
        return nil
      else
        Dim f As New FolderItem( zSaveInfo )
        return f
      end if
      
    End Function

    The crash is on the "Dim f As New FolderItem( zSaveInfo )" line.

    I have no idea how to work around this.

    This here works for FolderitemAlias:

    Public Sub Constructor(f As FolderItem)
      myNativePath = f.NativePath
    End Sub
    
    Public Function Resolve() as FolderItem
      
      if myNativePath = "" then
        Return Nil
      else
        dim f as new FolderItem(myNativePath, FolderItem.PathTypeNative)
        Return f
      end if
      
    End Function
  2. Beatrix W

    Feb 2 Testers, Third Party Store Europe (Germany)

    That's an exception and not a crash. Mac, Windows or Linux? Where are you saving the document to?

  3. Beatrix W

    Feb 2 Testers, Third Party Store Europe (Germany)

    Must be a 2019r3 problem. I get the exception, too.

  4. Walter P

    Feb 2 Testers, Xojo Pro

    macOS 10.14.6 (Mojave). It doesn't matter where I try to save the document to — Documents, Desktop, secondary drive, all yield the same problem. I'm using Xojo 2019r3.

  5. Beatrix W

    Feb 2 Testers, Third Party Store Europe (Germany)
    Edited 5 months ago

    Well, then try the debugger. As far as I can see the SaveInfo is the problem.

  6. Walter P

    Feb 2 Testers, Xojo Pro

    Yes, I already stepped through it in the debugger. The SaveInfo is the problem. Trying to create a FolderItem with it causes the exception. But I don't know how to fix that. I mean, I could probably figure out how to create the FolderItem in a different way, one that doesn't crash, but I don't understand the Kaju code well enough to know why it's the way it is or what changes would be prudent. If that's what it takes, I guess that's what I'll do, but clearly this exception shouldn't be and hasn't been happening, so I'm hoping someone who knows the code better (like that Kem fellow, for instance) will have some advice.

  7. Walter P

    Feb 3 Testers, Xojo Pro

    @Beatrix W Must be a 2019r3 problem. I get the exception, too.

    Ah, didn't notice this. Perhaps it is an r3 problem. I had it working earlier in the week on a different machine, but my default Xojo on that machine is an earlier version.

  8. Beatrix W

    Feb 3 Testers, Third Party Store Europe (Germany)

    Not sure if this is a Xojo bug or just a gotcha. At least it used to work in former versions of Xojo.

    Try the following code:

    dim f as FolderItem = SpecialFolder.Desktop.Child("blabla")
    dim s as String = f.SaveInfo(volume(0))
    
    f = SpecialFolder.Desktop
    s = f.SaveInfo(volume(0))

    For the first test the folderitem doesn't exist and you get the result you see in Kaju Admin. The second test works because the folderitem exists.

    The main window in Kaju Admin works with the problematic FolderitemAlias class. Therefore, writing to the document and then making the SaveInfo wouldn't work. I'm going to remove the SaveInfo and use a NativePath instead.

  9. Beatrix W

    Feb 3 Testers, Third Party Store Answer Europe (Germany)

    This here works for FolderitemAlias:

    Public Sub Constructor(f As FolderItem)
      myNativePath = f.NativePath
    End Sub
    
    Public Function Resolve() as FolderItem
      
      if myNativePath = "" then
        Return Nil
      else
        dim f as new FolderItem(myNativePath, FolderItem.PathTypeNative)
        Return f
      end if
      
    End Function
  10. Walter P

    Feb 3 Testers, Xojo Pro

    Perfect. Thank you!

  11. Kem T

    Feb 3 Testers, Xojo Pro, XDC Speakers, MVP Connecticut

    That may work but defeats the purpose of using SaveInfo (to track the file as an alias).

    I'm going to look at the whole package to get it up to speed with the latest version of Xojo and Catalina, hopefully this week.

  12. Walter P

    Feb 3 Testers, Xojo Pro

    I'm going to look at the whole package to get it up to speed with the latest version of Xojo and Catalina, hopefully this week.

    Sounds good. Thanks!

  13. Beatrix W

    Feb 3 Testers, Third Party Store Europe (Germany)
    Edited 5 months ago

    The last time I checked the SaveInfo it didn't work anyways when the file was moved.

  14. Kem T

    Feb 3 Testers, Xojo Pro, XDC Speakers, MVP Connecticut

    There was a bug that had been fixed, I thought. But anyway, I'll check it and work around it if needed, even if I have to use system calls.

or Sign Up to reply!