0

在 Windows Phone 8/8.1 上,navigator.camera.getPicture 打开 photolibrary 并调用 onSuccess 回调函数,但同时它引发以下错误“'System.NullReferenceException'发生在 worklight-windowsphone8.DLL ”关闭工作灯应用程序 --Scenerio Worklight 6.3.0 windowsphone8 环境新环境已创建。cordova 3.6 on button click Windows Phone 8/8.1 photogallery is open image is selected and photoalbum closes and I see the length in alert 但同时引发上述错误。

--code on button click
function onClickB(){
navigator.camera.getPicture(onSuccess, onFail, {
        quality : 20,
        destinationType : navigator.camera.DestinationType.DATA_URL,
        sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY
    });

function onSuccess(imageData) 
    {
       alert(imageData.length);--it gives me length Number
       var VarUsedtoSendToAdapter=imageData;
    }

    --OnVS Debug Console get 
    System.NullReferenceException' occurred in worklight-windowsphone8.DLL on Continue it closes the application
4

1 回答 1

0

我们无法重现该问题。

重新创建的步骤 -

使用的代码 -

function onClickB(){

        navigator.camera.getPicture(onSuccess, onFail, {
        quality : 20,
        destinationType : navigator.camera.DestinationType.DATA_URL,
        sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY
      });


    function onSuccess(imageData){
       alert(imageData.length);
       var VarUsedtoSendToAdapter=imageData;
    }

    function onFail(message){
       alert ("Failed because " + message);
    }

}

试验一:

环境 -

IBM MobileFirst 工作室 - 6.3.0.00-20141127-1357 Visual Studio Professional 2013 更新 2 目标 - Windows Phone 8.0

试验二:

IBM MobileFirst 工作室 - 6.3.0.00-20150214-1702 Visual Studio Professional 2013 更新 2 目标 - Windows Phone 8.0

结果(在两个试验中)-

1) 设备 1 - 诺基亚 Lumia 1520 - WP 8.1 更新 1

   Library launches, we select file , length is alerted. 
   The message -"System.NullReferenceException' occurred in worklight-windowsphone8.DLL" does not appear

2) 设备 2 - HTC 8x (Windows 8.0

    Library launches, we select file , length is alerted. 
   The message -"System.NullReferenceException' occurred in worklight-windowsphone8.DLL" does not appear

使用相册和相机胶卷中不同文件大小的多张图像进行测试,结果相同。

问题:

1) 问题是否出现在 Mobile First 6.3 工作室新创建的项目中?

2) 项目迁移到 6.3 了吗?如果是这样,您能否尝试删除 WP 8 环境并重新添加?

于 2015-03-26T11:38:47.790 回答