Bug? Supabase Storage.MoveFile Error

metzeller_2013

Member
Licensed User
Longtime User
Has anyone encountered this error? have no success in moving files on supabase
Here the error I get

Error on supabase library storage FileMove:
Error occurred on line: 37 (Main)
java.lang.ClassCastException: class b4j.example.supabase$_supabasestoragebucket cannot be cast to class b4j.example.supabase$_supabasestoragefile (b4j.example.supabase$_supabasestoragebucket and b4j.example.supabase$_supabasestoragefile are in unnamed module of loader 'app')
    at b4j.example.main$ResumableSub_MoveFile.resume(main.java:215)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1118)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)

Im just running this code, App is already login
Supabase MoveFile Code:
    Wait For (xSupa.Storage.MoveFile("KKMC.Files","OfficeData/02-20-2025_111_ROLLY_B_1011.zip", "TrashBin/02-20-2025_111_ROLLY_B_1011.zip").Execute) Complete (StorageFile As SupabaseStorageFile)
    If StorageFile.Error.Success Then
        Log($"Files successfully moved "$)
    Else
        Log("Error: " & StorageFile.Error.ErrorMessage)
        
    End If
 

Alexander Stolte

Expert
Licensed User
Longtime User
Please test with the version in the attachement
B4X:
    Wait For (xSupabase.Storage.MoveFile("KKMC.Files","OfficeData/test.png", "TrashBin/avater2.png","").Execute) Complete (StorageFile As SupabaseStorageFile)
    If StorageFile.Error.Success Then
        Log($"Files successfully moved "$)
    Else
        Log("Error: " & StorageFile.Error.ErrorMessage)
    End If
 

Attachments

  • Supabase.b4xlib
    34.4 KB · Views: 98

metzeller_2013

Member
Licensed User
Longtime User
Thank you very much, this solved it...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…