Reputation: 268
I'm having problems to create a virtual machine of the Tizen Emulator Wearable (2.3.1). Everything is installed properly but once I want to create a new virtual machine it return error 133. I'm running Mac OS X (10.9.5).
JAVA HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre
JAVA VENDOR: Oracle Corporation
JAVA VERSION: 1.8.0_40
OS ARCH: x86_64
OS NAME: Mac OS X
OS VERSION: 10.9.5
SWT PLATFROM: cocoa
SWT VERSION: 4527
[2016.8.17 9:1:45.269][INFO][About.printSystemInformation] EmulatorManager Information
Version: 2.4.0_Rev8
Build time: 20160608-1400 (GMT)
Git version: fatal: Not a git repository (or any of the parent directories): .git
Workspace path: /Users/xruiz/tizen-sdk-data/emulator/vms
Package version: 2.4.199
[2016.8.17 9:1:45.286][INFO][EmulatorManager.main] Start Emulator Manager!!
[2016.8.17 9:1:45.306][INFO][CheckGPU.work] Support GPU: true
[2016.8.17 9:1:45.306][INFO][CheckGPU.work] Gallium: false
[2016.8.17 9:1:45.306][INFO][Overseer$1.run] Overseer [Checkers] is done...
[2016.8.17 9:1:49.844][INFO][NameItem.checkVMName] If you do not need this VM(), delete VM folder.
[2016.8.17 9:1:50.486][INFO][TemplateLoader.loadTemplate] 2.3.1-wearable-circle-template-v2.xml is loaded for 2.3.1-wearable-circle
[2016.8.17 9:1:50.504][WARNING][StandardPlatform.makeItemList] Fail to load ItemListFactory. Image : 2.3.1-wearable-circle
[2016.8.17 9:1:50.504][INFO][StandardPlatform.makeItemList] Use CommonItemListFactory.
[2016.8.17 9:1:50.552][INFO][TemplateLoader.loadTemplate] 2.3.1-wearable-circle-template-v2.xml is loaded for 2.3.1-wearable
[2016.8.17 9:1:50.552][WARNING][StandardPlatform.makeItemList] Fail to load ItemListFactory. Image : 2.3.1-wearable
[2016.8.17 9:1:50.552][INFO][StandardPlatform.makeItemList] Use CommonItemListFactory.
[2016.8.17 9:1:55.643][WARNING][QemuImgProc$1.run] Failed check base image...(from qemu-img)
dyld: Library not loaded: @rpath/libz.1.2.8.dylib
[2016.8.17 9:1:55.644][WARNING][QemuImgProc$1.run] Failed check base image...(from qemu-img)
Referenced from: /Users/xruiz/tizen-sdk/tools/emulator/bin/qemu-img
[2016.8.17 9:1:55.644][WARNING][QemuImgProc$1.run] Failed check base image...(from qemu-img)
Reason: image not found
[2016.8.17 9:1:56.29][WARNING][QemuImgProc.RunningForCheckImg] Error while running 'qemu-img'. Exit value : 133
[2016.8.17 9:1:56.32][WARNING][Creator.createInternal] Failed to create the VM: Error while running 'qemu-img'. Exit value : 133
You can get more information in log file (/Users/xruiz/tizen-sdk-data/emulator/vms/emulator-manager)
[2016.8.17 9:1:56.35][WARNING][CreateVMTableViewer.createEmulator] Failed to create Emulator (w-0817-1)
Error while running 'qemu-img'. Exit value : 133
Any idea of how to proceed?
Upvotes: 2
Views: 1214
Reputation: 5249
That error happens because emulator executable (qemu-img) uses run-path (rpath) to look for dynamic libraries:
otool -L qemu-img
qemu-img:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/libz.1.2.8.dylib (compatibility version 1.0.0, current version 1.2.8)
@rpath/libgthread-2.0.0.dylib (compatibility version 4801.0.0, current version 4801.1.0)
@rpath/libglib-2.0.0.dylib (compatibility version 4801.0.0, current version 4801.1.0)
@rpath/libintl.8.dylib (compatibility version 10.0.0, current version 10.4.0)
/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
where @rpath is defined as:
Load command 23
cmd LC_RPATH
cmdsize 32
path @executable_path (offset 12)
@executable_path in its turn has a special meaning on Mac and is not the same as a path where qemu-img is located.
To fix the problem do this:
cd <root>/tizen-sdk/tools/emulator/bin
install_name_tool -add_rpath "<root>/tizen-sdk/tools/emulator/bin/" qemu-img
where <root> is a directory where tizen-sdk is installed.
Verify that your @rpath list has been modified:
otool -l qemu-img
You should see on the bottom:
Load command 24
cmd LC_RPATH
cmdsize 56
path <root>/tizen-sdk/tools/emulator/bin/
Now restart your Emulator Manager and it should work.
Another way of fixing it is to copy libraries (*.dylib) from <root>/tizen-sdk/tools/emulator/bin/ to /usr/local/lib, but be careful with this approach, do not overwrite a library if it already exists. In my case I needed to copy:
libglib-2.0.0.dylib
libgthread-2.0.0.dylib
libiconv.2.dylib
libintl.8.dylib
libpcre.1.dylib
libz.1.2.8.dylib
The second approach is risky, because it can affect other applications and I would not recommend it.
UPDATE FOR TIZEN STUDIO I've just downloaded the new Tizen Studio 1.0 and found out that its emulator has the same problem. Fortunately, the same fix works for this one as well, but you need to patch two executables:
<root>/tizen-studio/tools/emulator/bin/qemu-img
<root>/tizen-studio/platforms/tizen-2.3.2/common/emulator/bin/emulator-x86_64
For the first one use the same command as for older tizen sdk (see above), for the second one use this:
cd <root>/tizen-studio/platforms/tizen-2.3.2/common/emulator/bin
install_name_tool -add_rpath "<root>/tizen-studio/platforms/tizen-2.3.2/common/emulator/bin" emulator-x86_64
UPDATE 2019/08/16: This problem doesn't exists in the newer versions of Tizen Studio, ver. 3+. If you still experience it, you probably have old SDK's. Delete old SDK manually and install new ones that come with Tizen Studio ver. 3+
Upvotes: 2
Reputation: 11
Just stumbled upon similar error with the Tizen Studio 1.0.2. The error is still there and suggested solution using install_name_tool worked for me.
Little tip to save you some typing:
cd <root>/tizen-studio/platforms/tizen-2.3.2/common/emulator/bin
install_name_tool -add_rpath $(pwd) emulator-x86_64
Upvotes: 0