2012-12-21 31 views
19

Chạy nó từ dòng lệnh dẫn đến một lỗi segmentation:giả lập Android Segmentation Fault

$ emulator -avd nexus_s 
Segmentation fault (core dumped) 

Tuy nhiên, chạy giả lập-cánh tay trực tiếp như sau, hoạt động tốt.

$ emulator-arm -avd nexus_s 

tôi nghi ngờ nó đang cố gắng để chạy mips hoặc phiên bản x86 của giả lập. Có cách nào để cấu hình trình giả lập có thể thực thi được không?

Tất cả điều này bắt đầu sau khi cập nhật lên android sdk 17.

Thêm cờ -verbose cho kết quả như sau (mà tôi không nghĩ thêm bất kỳ thông tin):

$ emulator -verbose -avd nexus_s 
emulator: found SDK root at /opt/sdk 
emulator: Android virtual device file at: /home/grebulon/.android/avd/nexus_s.ini 
emulator: virtual device content at /home/grebulon/.android/avd/nexus_s.avd 
emulator: virtual device config file: /home/grebulon/.android/avd/nexus_s.avd/config.ini 
emulator: using core hw config path: /home/grebulon/.android/avd/nexus_s.avd/hardware-qemu.ini 
emulator: Found AVD target API level: 17 
emulator: 'magic' skin format detected: 480x800 
emulator: autoconfig: -skin 480x800 
emulator: autoconfig: -skindir (null) 
emulator: keyset loaded from: /home/grebulon/.android/default.keyset 
emulator: found magic skin width=480 height=800 bpp=16 

emulator: autoconfig: -kernel /opt/sdk/system-images/android-17/armeabi-v7a//kernel-qemu 
emulator: autoconfig: -ramdisk /opt/sdk/add-ons/addon-google_apis-google-17/images/armeabi-v7a//ramdisk.img 
emulator: Using initial system image: /opt/sdk/add-ons/addon-google_apis-google-17/images/armeabi-v7a//system.img 
emulator: autoconfig: -data /home/grebulon/.android/avd/nexus_s.avd/userdata-qemu.img 
emulator: autoconfig: -initdata /home/grebulon/.android/avd/nexus_s.avd/userdata.img 
emulator: autoconfig: -cache /home/grebulon/.android/avd/nexus_s.avd/cache.img 
emulator: Physical RAM size: 343MB 

Content of hardware configuration file: 
    hw.cpu.arch = arm 
    hw.cpu.model = cortex-a8 
    hw.ramSize = 343 
    hw.screen = touch 
    hw.mainKeys = yes 
    hw.trackBall = no 
    hw.keyboard = no 
    hw.keyboard.lid = no 
    hw.keyboard.charmap = qwerty2 
    hw.dPad = no 
    hw.gsmModem = yes 
    hw.gps = yes 
    hw.battery = no 
    hw.accelerometer = yes 
    hw.audioInput = yes 
    hw.audioOutput = yes 
    hw.sdCard = yes 
    disk.cachePartition = yes 
    disk.cachePartition.path = /home/grebulon/.android/avd/nexus_s.avd/cache.img 
    disk.cachePartition.size = 66m 
    hw.lcd.width = 480 
    hw.lcd.height = 800 
    hw.lcd.depth = 16 
    hw.lcd.density = 240 
    hw.lcd.backlight = yes 
    hw.gpu.enabled = yes 
    hw.camera.back = none 
    hw.camera.front = none 
    vm.heapSize = 32 
    hw.sensors.proximity = yes 
    hw.sensors.magnetic_field = yes 
    hw.sensors.orientation = yes 
    hw.sensors.temperature = yes 
    kernel.path = /opt/sdk/system-images/android-17/armeabi-v7a//kernel-qemu 
    kernel.parameters = android.checkjni=1 
    disk.ramdisk.path = /opt/sdk/add-ons/addon-google_apis-google-17/images/armeabi-v7a//ramdisk.img 
    disk.systemPartition.initPath = /opt/sdk/add-ons/addon-google_apis-google-17/images/armeabi-v7a//system.img 
    disk.systemPartition.size = 200m 
    disk.dataPartition.path = /home/grebulon/.android/avd/nexus_s.avd/userdata-qemu.img 
    disk.dataPartition.size = 209m 
    avd.name = nexus_s 
. 
QEMU options list: 
emulator: argv[00] = "/opt/sdk/tools/emulator64-arm" 
emulator: argv[01] = "-android-hw" 
emulator: argv[02] = "/home/grebulon/.android/avd/nexus_s.avd/hardware-qemu.ini" 
Concatenated QEMU options: 
/opt/sdk/tools/emulator64-arm -android-hw /home/grebulon/.android/avd/nexus_s.avd /hardware-qemu.ini 
emulator: registered 'boot-properties' qemud service 
emulator: nand_add_dev: system,size=0xc800000,initfile=/opt/sdk/add-ons/addon-google_apis-google-17/images/armeabi-v7a//system.img 
emulator: mapping 'system' NAND image to /tmp/android-grebulon/emulator-RSuUtb 
emulator: rounding devsize up to a full eraseunit, now c810000 

emulator: nand_add_dev: userdata,size=0xd100000,file=/home/grebulon/.android/avd/nexus_s.avd/userdata-qemu.img 
emulator: rounding devsize up to a full eraseunit, now d116000 

emulator: registered 'boot-properties' qemud service 
emulator: Adding boot property: 'dalvik.vm.heapsize' = '32m' 
emulator: Adding boot property: 'qemu.sf.lcd_density' = '240' 
emulator: Adding boot property: 'qemu.hw.mainkeys' = '1' 
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'none' 
emulator: nand_add_dev: cache,size=0x4200000,file=/home/grebulon/.android/avd/nexus_s.avd/cache.img 
emulator: Initializing hardware OpenGLES emulation support 
Segmentation fault (core dumped) 
+1

OS X? Linux? Một số phiên bản vũ trụ song song lạ của Windows, nơi họ cũng đã sử dụng dấu nhắc lệnh '$'? – CommonsWare

+0

Linux, ubuntu 12.04 phải cụ thể. – grebulon

+3

Hãy thử thêm '-v' vào dòng lệnh' emulator' và xem nó xuất hiện ở đâu. Tôi đã có một vấn đề với 'giả lập' trên các công cụ Android R21 bị rơi khi cố gắng tải trình điều khiển OpenGL trên Ubuntu 11.10 - có vấn đề về nó trên b.android.com, nơi giải pháp thay đổi tên trình điều khiển OpenGL để Android có thể Không tìm thấy nó. – CommonsWare

Trả lời

24

cuối cùng tôi đã tìm thấy một giải pháp sau khi làm theo mẹo của CommonsWare. Đổi tên libOpenglRender.so đã khiến vấn đề biến mất.

mv tools/lib/libOpenglRender.so tools/lib/libOpenglRender.so.xxx 
+4

Điều này làm cho trình giả lập hiển thị. nhưng nó xuất ra thông báo lỗi sau: giả lập: LRI: Không thể tải thư viện thi đua OpenGLES: lib64OpenglRender.so: không thể mở tệp đối tượng được chia sẻ: Không có tệp hoặc thư mục nào như vậy giả lập: CẢNH BÁO: Không thể khởi tạo giả lập OpenglES, bằng cách sử dụng trình kết xuất phần mềm. –

+0

THANK YOU VERY MUCH !!! Sau hơn một tuần thử tất cả mọi thứ ở đây và đổi tên tất cả các tệp *. * * Từ /tools/lib/thành lib *. *. Xxx làm cho trình giả lập bắt đầu. Tôi đã đúng, tất cả các vấn đề mô phỏng sự cố liên quan đến OpenGLES: https://code.google.com/p/android/issues/detail?id=33336 & https://code.google.com/p/android/ Các vấn đề/chi tiết? id = 28601 – warmth

+0

Để đổi tên 64 bit tệp lib64OpenglRender.so thành lib64OpenglRender.so.xxx. –

1

Trên hệ thống Ubuntu 12.04 của tôi, tôi giải quyết vấn đề này bằng cách đảm bảo "Sử dụng máy chủ GPU" không được bật trong cấu hình AVD.

1

Loại lệnh

$ emulator-cánh tay @nexus_s

Hope this helps :-)

0

tôi đã cùng một vấn đề trên Debian Wheezy. Câu trả lời của grebulon đã làm việc cho tôi, tuy nhiên người giả lập là sloooooow nên tôi bắt đầu sửa chữa nó The Way Right (tm).

Trong trường hợp này Segmentation fault có thể cho biết sự cố với OpenGL. (lưu ý rằng dòng cuối cùng của bản ghi là "giả lập: Khởi OpenGLES phần cứng hỗ trợ thi đua")

Trong trường hợp của tôi, tìm kiếm cho 'GL' qua /var/log/Xorg.0.log cho thấy một số tài xế NVidia GLX (từ card màn hình cũ mà đi lên thiên đàng kỹ thuật số). Căn cứ vào thực tế là tôi có AMD Radeon tôi gỡ bỏ cài đặt tất cả các gói với 'nvidia' trong nó (danh sách: apt-get search nvidia | grep ^i) và cài đặt:

# apt-get install libgl1-fglrx-glx 

Sau khi khởi động lại giả lập phàn nàn về việc thiếu libOpenglRender.solibGL.so, mà tôi giải quyết như thế này:

# echo "/opt/adt/sdk/tools/lib" > /etc/ld.so.conf.d/android_stuff.conf 
# ldconfig 
# cd /opt/adt/sdk/tools/lib 
# ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 libGL.so 

Lưu ý rằng trường hợp của tôi có thể là duy nhất (các sự cố bắt đầu khi tôi chuyển từ NVidia sang AMD), nhưng gốc của vấn đề có thể tương tự (OpenGL). Tôi hi vọng nó giúp ích cho ai đó.

CẬP NHẬT: vẫn không hoạt động, có vẻ như trình điều khiển của tôi không hỗ trợ màu 16 bit trong OpenGL ... sẽ điều tra thêm.

Các vấn đề liên quan