MaxiHuHe04 / iTunes-Backup-Explorer

A graphical tool that can extract and replace files from encrypted and non-encrypted iOS backups
MIT License
457 stars 37 forks source link

java.util.NoSuchElementException: No value present #8

Closed SvetaSR closed 1 year ago

SvetaSR commented 1 year ago

Hi there. Thank you for this nice tool! I was trying to run it though, and get the following error. The program does open but won't let me open my backup file.

D:\test-temp>java -jar itunes-backup-explorer-1.2.jar
אוג? 12, 2022 4:35:20 אחה?צ com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @78b0aab6'
me.maxih.itunes_backup_explorer.api.BackupReadException: me.maxih.itunes_backup_explorer.api.BackupReadException: java.util.NoSuchElementException: No value present
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.loadInfo(ITunesBackup.java:93)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.<init>(ITunesBackup.java:70)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.lambda$getBackups$0(ITunesBackup.java:31)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.getBackups(ITunesBackup.java:41)
        at me.maxih.itunes_backup_explorer.ui.WindowController.loadBackups(WindowController.java:135)
        at me.maxih.itunes_backup_explorer.ui.WindowController.initialize(WindowController.java:76)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:77)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:275)
        at com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2673)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516)
        at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.start(ITunesBackupExplorer.java:21)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: me.maxih.itunes_backup_explorer.api.BackupReadException: java.util.NoSuchElementException: No value present
        at me.maxih.itunes_backup_explorer.api.BackupInfo.<init>(BackupInfo.java:74)
        at me.maxih.itunes_backup_explorer.api.ITunesBackup.loadInfo(ITunesBackup.java:91)
        ... 32 more
Caused by: java.util.NoSuchElementException: No value present
        at java.base/java.util.Optional.orElseThrow(Optional.java:377)
        at me.maxih.itunes_backup_explorer.api.BackupInfo.<init>(BackupInfo.java:59)
        ... 33 more

My Java version is

java version "18.0.2" 2022-07-19
Java(TM) SE Runtime Environment (build 18.0.2+9-61)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing

Thanks!

MaxiHuHe04 commented 1 year ago

Hey! Could you give me some details about your system and the backup you were trying to open? Which operating system do you use? If Windows, what iTunes version? Which device and i(Pad)OS version is the backup from?

Apparently, the product name is missing from the backup info file. I thought it would be included in every backup, but maybe it is omitted in some configuration. I will make the value optional when loading the backup.

SvetaSR commented 1 year ago

Hi @MaxiHuHe04 sure. Windows 10 Pro (OS build 19043.1889) Itunes 12.9.2.6 The backup is of an iPhone 6 with iOS 10.2. The backup was created with a tool called CopyTrans, as iTunes required a factory restore 😨 (hate that program).

TianLing2020 commented 1 year ago

I met the same prolem. Use Tool: i4tool.cn Windows: Win11 Java:18

when i use the iTunes to backup. The problem has fixed. But use the i4tool to backup ,will be failed

MaxiHuHe04 commented 1 year ago

I'm sorry I haven't got around to fixing this until now. I'd appreciate it if someone could test it and reopen the issue if there are still problems.