Cordova摄像头插件崩溃iOS-r0.3.5

Cordova摄像头插件崩溃iOS-r0.3.5,cordova,cordova-plugins,Cordova,Cordova Plugins,我在iOS上遇到了org.apache.cordova.camera r0.3.5的问题。r0.3.4对我来说一切都很好。当我尝试拍照时,应用程序立即崩溃。请查看导致问题的线路 - (void)takePicture:(CDVInvokedUrlCommand*)command { .... [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^ Thread 3: EXC

我在iOS上遇到了org.apache.cordova.camera r0.3.5的问题。r0.3.4对我来说一切都很好。当我尝试拍照时,应用程序立即崩溃。请查看导致问题的线路

- (void)takePicture:(CDVInvokedUrlCommand*)command
{
  ....
  [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^
Thread 3: EXC_BAD_ACCESS 
}

2015-02-27 09:28:50.332 App[1455:860f] bool
_WebTryThreadLock(bool), 0x1ee707a0: Tried to obtain the web lock from 
a thread other than the main thread or the web thread. This may be a 
result of calling to UIKit from a secondary thread. Crashing now...
1   0x39e643b7 WebThreadLock
2   0x35fc5b4f <redacted>
3   0x35e01691 <redacted>
4   0x36042619 <redacted>
5   0x35e549b9 <redacted>
6   0x35e52fe7 <redacted>
7   0x21d93 __25-[CDVCamera takePicture:]_block_invoke
8   0x3bfd311f <redacted>
9   0x3bfe1259 <redacted>
10  0x3bfe13b9 <redacted>
11  0x3c007a11 <redacted>
12  0x3c0078a4 start_wqthread
-(void)takePicture:(CDVInvokedUrlCommand*)命令
{
....
[weakSelf.viewController presentViewController:cameraPicker动画:是完成:^
线程3:EXC_坏访问
}
2015-02-27 09:28:50.332 App[1455:860f]布尔
_WebTryThreadLock(bool),0x1ee707a0:试图从中获取web锁
主线程或web线程以外的线程。这可能是
从辅助线程调用UIKit的结果。正在崩溃。。。
1 0x39e643b7 WebThreadLock
2 0x35fc5b4f
3 0x35e01691
4 0x36042619
5 0x35e549b9
6 0x35e52fe7
7 0x21d93\uuuu25-[CDV摄像机拍摄:]\uBlock\uInvoke
8 0x3bfd311f
9 0x3bfe1259
10 0x3bfe13b9
11 0x3c007a11
12 0x3c0078a4启动线程

谢谢,

我遇到了同样的问题。我对它进行了一些调试,问题出在CDVCamera.m文件上。在第170行,您有以下代码

[weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{
    weakSelf.hasPendingOperation = NO;
}];
整个调用应该在主线程中调度

dispatch_async(dispatch_get_main_queue(), ^{
    [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{
         weakSelf.hasPendingOperation = NO;
    }];
});

因此,简而言之,您可以选择新版本,即r0.3.6,也可以自己更改。万一您不知道,您会在“org.apache.cordova.camera”文件夹下的插件文件夹中找到此文件。干杯!!

您能解决此问题吗?