subscribe

You can update this text in your control panel, under Theme Options. Nam massa. Ut tempor augue non sapien lobortis aliquam. Maecenas.

Get DDMS working on 64bit Fedora

August 13th, 2009

The Dalvik Debug Monitor Service (DDMS) is a debugging tool. It is designed for  dalvik, the java based virtual machine used in Android. DDMS comes with the Android SDK. This sdk is only for 32bit platforms created, but most of the included parts runs on  64bit without problems.

Today i want start DDMS to make screenshots and i got this error:
[android@fedora android]# android-sdk-linux_x86-1.5_r3/tools/ddms
Error Loading Preferences
44:57 E/ddms: shutting down due to uncaught exception
44:57 E/ddms: java.lang.UnsatisfiedLinkError: android/android-sdk-linux_x86-1.5_r3/tools/lib/libswt-pi-gtk-3236.so: android/android-sdk-linux_x86-1.5_r3/tools/lib/libswt-pi-gtk-3236.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
at com.android.sdkstats.SdkStatsService.getUserPermission(SdkStatsService.java:278)
at com.android.sdkstats.SdkStatsService.ping(SdkStatsService.java:126)
at com.android.ddms.Main.main(Main.java:89)

The analyse shows DDMS is a java program with the gui toolkit SWT. Java runs on all platforms with a Java Runtime Environment (jre). SWT always has a platform dependency, because it use native widgets. So the main problem is, the swt bundled in the SDK cannot run on a x86_64 based linux system.

To fix this a replace of the bundled swt is needed. The file is located under android-sdk-linux_x86-1.5_r3/tools/lib/. Rename swt.jar to swt_32b.jar. Next download swt for your platform. I have used swt-3.4.2-gtk-linux-x86_64.zip. Unpack the file swt.jar in the zipfile to android-sdk-linux_x86-1.5_r3/tools/lib/ and finally start ddms and you see this:

bildschirmfoto-dalvik-debug-monitor

After the steps it is no problem to make screenshots of your running android system in your mobile phone. If you have problems with this hack, write a comment please.

Tags: , , , , , , , , ,

2 Responses to Get DDMS working on 64bit Fedora

  1. capoeira says:

    not work if the rename swt_32b.jar, moves the file to another position or would move back up, I had to copy the file libswt-pi-gtk on new swt.jar inside the same directory / tools / lib / and it worked . I hope it have was helpful

  2. jettrue says:

    Thank you, thank you, this worked for me, other instructions said to force 32 bit, but forcing 64 bit worked for me.

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.

*