Androxyde / Flashtool

Xperia device flashing
GNU General Public License v3.0
476 stars 245 forks source link

Hangs on "Downloading latest XperiFirm" #35

Open benfrancis opened 8 years ago

benfrancis commented 8 years ago

Steps to reproduce:

Expected:

Actual:

Tested on both Ubuntu LTS and OS X, same result.

Log output:

10/000/2016 17:00:59 - INFO  - Flashtool Version 0.9.22.3 built on 08-06-2016 22:30:00
10/000/2016 17:00:59 - INFO  - libusb version 1.0.20
10/000/2016 17:00:59 - INFO  - Executing search strategies to find proxy selector
10/000/2016 17:00:59 - INFO  - No proxy found for gnome. Trying next one
10/000/2016 17:00:59 - INFO  - No proxy found for kde. Trying next one
10/000/2016 17:00:59 - INFO  - No proxy found for firefox. Trying next one
10/000/2016 17:00:59 - INFO  - Syncing devices from github
10/000/2016 17:00:59 - INFO  - Opening devices repository.
10/001/2016 17:01:00 - INFO  - Scanning devices folder for changes.
10/001/2016 17:01:00 - INFO  - Pulling changes from github.
10/001/2016 17:01:00 - INFO  - Pull failed. Trying to clone repository instead
10/001/2016 17:01:00 - INFO  - Quietly closing devices repository.
10/001/2016 17:01:00 - INFO  - Cloning devices repository to /home/tola/.flashTool/devices
10/001/2016 17:01:10 - INFO  - Quietly closing devices repository.
10/001/2016 17:01:10 - INFO  - Devices sync finished.
10/001/2016 17:01:10 - INFO  - Loading devices database
10/001/2016 17:01:11 - INFO  - Loaded 91 devices
10/001/2016 17:01:11 - INFO  - Starting phone detection
10/001/2016 17:01:14 - INFO  - Device connected with USB debugging off
10/001/2016 17:01:14 - INFO  - For 2011 devices line, be sure you are not in MTP mode
10/001/2016 17:01:29 - INFO  - Device connected with USB debugging on
10/001/2016 17:01:30 - INFO  - Connected device : Sony Xperia Z2 Tablet
10/001/2016 17:01:30 - INFO  - Installed version of busybox : N/A
10/001/2016 17:01:30 - INFO  - Android version : 4.4.2 / kernel version : 3.4.0-perf-g35f9635 / Build number : 17.1.2.A.0.314
10/001/2016 17:01:30 - INFO  - Root access denied
10/001/2016 17:01:35 - INFO  - Downloading latest XperiFirm

I wonder if there's an uncaught Java exception somewhere because I noticed that when I ran:

./FlashToolConsole --action=imei

I got:

Used java home : ./x10flasher_lib/linjre64
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/custom/StyledText
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.createBuilder(PluginBuilder.java:149)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:119)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:888)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:828)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:820)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:449)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:197)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:209)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:492)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:246)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:171)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:82)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:64)
    at gui.Main.main(Main.java:21)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.custom.StyledText
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 17 more
benfrancis commented 8 years ago

On Ubuntu it seems I was just missing mono as a dependency for XperiFirm - maybe just an error message needed to catch this?

Fixed with: $ sudo apt-get install mono-complete

Not sure about OS X

Androxyde commented 8 years ago

Xperifim is just integrated to flashtool. If ever you check official xperifirm thread on XDA, you will see mono is required on Linux and MacOS :-) The author gives tutorials on how to have XperiFirm working on OS other than Windows

Androxyde commented 8 years ago

For the flashtoolconsole failure I think I know what it is ;-) looks like a bad classpath on java call. I will check

mcfisch commented 7 years ago

BTW, this happens to me with Windows 7 & 10 (both x64). Running Xperifirm separately works fine, but it never starts off of Flashtool. Tried v0.9.19.8 and 0.9.23.0 with no success. Having the device (Z4 Tablet) plugged in or not doesn't make any difference.

mcfisch commented 7 years ago

On the Win7 I've verified that .Net 4.6.1 is installed. Dunno how it is implemented here, but I can i.e. use the .Net WebClient class in PowerShell scripts with no issues, for instance. Win10 comes with .Net anyways.

However, storing the downloaded XperiFirm.exe in %userprofile%/.flashtool/ works, it gets loaded by Flashtool and goes well from there.

sumdog commented 7 years ago

I get the same issue when running the CLI tool on Linux64:

./FlashToolConsole --action=flash --file=/root/.flashTool/firmwares/E5823_32.2.A.0.305_1298-7256_R5C.ftf
Used java home : ./x10flasher_lib/linjre64
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/custom/StyledText
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.createBuilder(PluginBuilder.java:149)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:119)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:888)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:828)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:820)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:449)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:197)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:209)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:492)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:246)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:171)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:82)
    at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:64)
    at gui.Main.main(Main.java:21)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.custom.StyledText
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

I changed the following to echo out the classpath:

    ISJAVA64=$($JAVA_HOME/bin/java -version 2>&1|grep 64-Bit|wc -l)
    CP=$(ls ./x10flasher_lib/*jar|xargs|tr ' ' ':')
    echo $CP

and it looks like all the eclipse/swt jars are in there:

./FlashToolConsole --action=flash --file=/root/.flashTool/firmwares/E5823_32.2.A.0.305_1298-7256_R5C.ftf
Used java home : ./x10flasher_lib/linjre64
./x10flasher_lib/AXMLPrinter2.jar:./x10flasher_lib/bcprov-jdk15on-152.jar:./x10flasher_lib/com.ibm.icu_56.1.0.v201601250100.jar:./x10flasher_lib/com.jcraft.jsch_0.1.53.v201508180515.jar:./x10flasher_lib/commons-io-2.4.jar:./x10flasher_lib/groovy-all-2.4.6.jar:./x10flasher_lib/guava-19.0.jar:./x10flasher_lib/ini4j-0.5.2.jar:./x10flasher_lib/javax.annotation_1.2.0.v201602091430.jar:./x10flasher_lib/javax.inject_1.0.0.v20091030.jar:./x10flasher_lib/jbbp-1.2.1.jar:./x10flasher_lib/jdom-1.1.1.jar:./x10flasher_lib/jna-4.2.2.jar:./x10flasher_lib/jna-platform-4.2.2.jar:./x10flasher_lib/jopt-simple-5.0.jar:./x10flasher_lib/jsr305-3.0.1.jar:./x10flasher_lib/log4j-api-2.5.jar:./x10flasher_lib/log4j-core-2.5.jar:./x10flasher_lib/log4j-slf4j-impl-2.5.jar:./x10flasher_lib/lz4-1.3.0.jar:./x10flasher_lib/nsisant-1.3.jar:./x10flasher_lib/org.eclipse.core.commands_3.8.0.v20160316-1921.jar:./x10flasher_lib/org.eclipse.core.contenttype_3.5.100.v20160418-1621.jar:./x10flasher_lib/org.eclipse.core.jobs_3.8.0.v20160509-0411.jar:./x10flasher_lib/org.eclipse.core.runtime_3.12.0.v20160606-1342.jar:./x10flasher_lib/org.eclipse.equinox.app_1.3.400.v20150715-1528.jar:./x10flasher_lib/org.eclipse.equinox.common_3.8.0.v20160509-1230.jar:./x10flasher_lib/org.eclipse.equinox.preferences_3.6.1.v20160815-1406.jar:./x10flasher_lib/org.eclipse.equinox.registry_3.6.100.v20160223-2218.jar:./x10flasher_lib/org.eclipse.jface_3.12.1.v20160923-1528.jar:./x10flasher_lib/org.eclipse.jface.text_3.11.2.v20161113-1700.jar:./x10flasher_lib/org.eclipse.jgit_4.4.1.201607150455-r.jar:./x10flasher_lib/org.eclipse.jgit.archive_4.4.1.201607150455-r.jar:./x10flasher_lib/org.eclipse.osgi_3.11.2.v20161107-1947.jar:./x10flasher_lib/org.eclipse.swt_3.105.2.v20161122-0613.jar:./x10flasher_lib/org.eclipse.text_3.6.0.v20160503-1849.jar:./x10flasher_lib/org.eclipse.ui.forms_3.7.0.v20160518-1929.jar:./x10flasher_lib/org.eclipse.ui.workbench_3.108.2.v20161025-2029.jar:./x10flasher_lib/rhino-1.7.7.1.jar:./x10flasher_lib/runtime_registry_compatibility.jar:./x10flasher_lib/slf4j-api-1.7.19.jar:./x10flasher_lib/slf4j-ext-1.7.19.jar:./x10flasher_lib/x10flasher-res.jar:./x10flasher_lib/xstream-1.4.9.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/custom/StyledText
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

The graphical version does come up and the classpath looks identical. Not sure what's up here.

theAkito commented 5 years ago

On Ubuntu it seems I was just missing mono as a dependency for XperiFirm - maybe just an error message needed to catch this?

Fixed with: $ sudo apt-get install mono-complete

Not sure about OS X

Thank you, this solved my issue on Debian Buster.

frankhommers commented 1 year ago

On the Win7 I've verified that .Net 4.6.1 is installed. Dunno how it is implemented here, but I can i.e. use the .Net WebClient class in PowerShell scripts with no issues, for instance. Win10 comes with .Net anyways.

However, storing the downloaded XperiFirm.exe in %userprofile%/.flashtool/ works, it gets loaded by Flashtool and goes well from there.

I had to rename XperiFirm-x64.exe XperiFirm.exe and do this. Thanks a lot!