我們在我們的項目中使用了Cordova相機插件。在應用iFix-7.1.0.0-MFPF-IF201703011645之前它工作正常。navigator.camera.getPicture在MFP後無法在android中使用iFIX - 7.1.0.0-MFPF-IF201703011645
請檢查下面的代碼片段的相機。
$scope.cameraOptions = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA
};
navigator.camera.getPicture(success , failure , $scope.cameraOptions);
Android的錯誤日誌:
03-21 20:36:41.990: E/PluginManager(29129): Uncaught exception from plugin
03-21 20:36:41.990: E/PluginManager(29129): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
03-21 20:36:41.990: E/PluginManager(29129): at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:560)
03-21 20:36:41.990: E/PluginManager(29129): at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:534)
03-21 20:36:41.990: E/PluginManager(29129): at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:376)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.camera.CameraLauncher.takePicture(CameraLauncher.java:278)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.camera.CameraLauncher.callTakePicture(CameraLauncher.java:258)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.camera.CameraLauncher.execute(CameraLauncher.java:167)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:86)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.PluginManager.exec(PluginManager.java:153)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:61)
03-21 20:36:41.990: E/PluginManager(29129): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
03-21 20:36:41.990: E/PluginManager(29129): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-21 20:36:41.990: E/PluginManager(29129): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
03-21 20:36:41.990: E/PluginManager(29129): at android.os.Handler.dispatchMessage(Handler.java:102)
03-21 20:36:41.990: E/PluginManager(29129): at android.os.Looper.loop(Looper.java:135)
03-21 20:36:41.990: E/PluginManager(29129): at android.os.HandlerThread.run(HandlerThread.java:61)
03-21 20:36:41.997: I/chromium(29129): [INFO:CONSOLE(204)] "Failed because: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference", source:
注意,請求緊迫感這裏給你一些當之無愧downvotes - 不要做它! – halfer