Android-DFU-Library icon indicating copy to clipboard operation
Android-DFU-Library copied to clipboard

4097 DFU FILE NOT FOUND

Open calkinssean opened this issue 3 years ago • 2 comments

DFU Bootloader version:

  • Are you using bonding: no
  • DFU Library version: 2.1.0

Device information:

  • Device: Galaxy Note8
  • OS: Android 9

Your question

I get the 4097 file not found error on this phone every time I try to set the zip. I do not get this error on my Pixel 3 XL running Android 12 with the same code

Putting the zip file in the raw folder is not an option for my situation. The firmware files need to be downloaded from the server directly. The file is downloaded and stored in the local storage. As far as I can tell, it is not a permission issue.

Logs

E/DfuBaseService: An exception occurred while opening file
    java.io.FileNotFoundException: No files found in the ZIP. Check if the URI provided is valid and the ZIP contains required files on root level, not in a directory.
        at no.nordicsemi.android.dfu.internal.ArchiveInputStream.parseZip(ArchiveInputStream.java:363)
        at no.nordicsemi.android.dfu.internal.ArchiveInputStream.<init>(ArchiveInputStream.java:142)
        at no.nordicsemi.android.dfu.DfuBaseService.openInputStream(DfuBaseService.java:1464)
        at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:1201)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:65)

calkinssean avatar Sep 09 '22 19:09 calkinssean

Are you sure your ZIP file os correct? The error is thrown here: https://github.com/NordicSemiconductor/Android-DFU-Library/blob/5e241dcbac51c6b8de8d000390b52e5d4b96fe1c/lib_dfu/src/main/java/no/nordicsemi/android/dfu/internal/ArchiveInputStream.java#L361-L365 Looks like the ZIP is either empty, or contains a folder with some files, instead of having those files directly in root folder.

philips77 avatar Sep 12 '22 12:09 philips77

Yeah, the file length is > 0 and the same code works on my phone running Android 12

calkinssean avatar Sep 12 '22 15:09 calkinssean