RoboVM应用程序在ptr.get()上崩溃 [英] RoboVM app crashes on ptr.get()

查看:99
本文介绍了RoboVM应用程序在ptr.get()上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要使ptr.get()工作需要某种魔术吗?由于某些原因,以下代码总是使我的应用程序崩溃:

Is there some kind of magic required to get ptr.get() to work? For some reason the following code always crashes my app:

    AudioStreamBasicDescription asbd = new AudioStreamBasicDescription(mSampleRate, mFormatID, mFormatFlags, mBytesPerPacket, mFramesPerPacket, mBytesPerFrame, mChannelsPerFrame, mBitsPerChannel, 0);
    AudioFilePtr outAudioFile = new AudioFilePtr();
    File f = File.createTempFile("ptt", ".caf"); 
    AudioFileError afe = AudioFile.createWithURL(new NSURL(f), 1667327590, asbd, 1, outAudioFile);
    System.out.println(afe.name());
    System.out.println(outAudioFile.get());

它成功地从AudioFile.createWithURL返回,没有错误(错误代码:否),但是当我尝试获取Java实例时便崩溃了.我还在另一段代码中遇到了相同类型的崩溃,在该段中,我将AudioQueuePtr实例化为queueptr,将其传递给AudioQueue.newInput并尝试调用queueptr.get().这里有我想念的东西吗?

It successfully returns from AudioFile.createWithURL with no errors (error code: No), but crashes as soon as I try to get the java instance. I'm also experiencing the same type of crash in another section of code where I instantiate an AudioQueuePtr as queueptr, pass it in to AudioQueue.newInput and try to call queueptr.get(). Is there something I'm missing here?

java中没有堆栈跟踪,但这是XCode Organizer设备日志:

There's no stack trace in java, but here's the XCode Organizer Device Log:

Incident Identifier: 2EEFF4F0-9031-4798-80E7-69F55BB70576
CrashReporter Key:   08d7c27d21cb15553295bbae1b2aa2040e94b517
Hardware Model:      iPhone3,1
Process:             iOS_RVM_NN [1972]
Path:                /var/mobile/Applications/B2571332-7C2F-4A5A-8932-8BF5EC94EE33/iOS_RVM_NN.app/iOS_RVM_NN
Identifier:          iOS_RVM_NN
Version:             1 (1.0)
Code Type:           ARM (Native)
Parent Process:      debugserver [1971]

Date/Time:           2014-12-02 11:22:50.710 -0500
OS Version:          iOS 7.1.2 (11D257)
Report Version:      104

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib          0x39838a58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39838854 mach_msg + 44
2   CoreFoundation                  0x2eaa2846 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2eaa0fb2 __CFRunLoopRun + 850
4   CoreFoundation                  0x2ea0beba CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2ea0bc9e CFRunLoopRunInMode + 102
6   GraphicsServices                0x3391165e GSEventRunModal + 134
7   UIKit                           0x31358148 UIApplicationMain + 1132
8   iOS_RVM_NN                      0x007b024e 0x8c000 + 7488078
9   iOS_RVM_NN                      0x007af7e2 0x8c000 + 7485410
10  iOS_RVM_NN                      0x007af822 0x8c000 + 7485474
11  iOS_RVM_NN                      0x00344afe 0x8c000 + 2853630
12  iOS_RVM_NN                      0x00953ca0 0x8c000 + 9206944
13  iOS_RVM_NN                      0x0094cbfa 0x8c000 + 9178106
14  iOS_RVM_NN                      0x0094e876 0x8c000 + 9185398
15  iOS_RVM_NN                      0x0094e8d0 0x8c000 + 9185488
16  iOS_RVM_NN                      0x00948ce6 0x8c000 + 9161958
17  iOS_RVM_NN                      0x009417ae 0x8c000 + 9131950
18  iOS_RVM_NN                      0x00212f84 0x8c000 + 1601412

推荐答案

原来,这是RoboVM绑定中的错误.应该在将来的版本中修复.在此处查看错误报告: https://github.com/robovm/robovm/issues/627

Turns out this was a bug in the RoboVM bindings. Should be fixed in future releases. View the bug report here: https://github.com/robovm/robovm/issues/627

此外,我在此处发布了完整的工作示例:

Also, I posted a full working example here: RoboVM implementation of recording demo using AudioQueue results in "No @Marshaler found" error

这篇关于RoboVM应用程序在ptr.get()上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆