我们在项目中使用Cordova相机插件。在应用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:
答案 0 :(得分:1)
作为临时解决方法,请将以下代码行添加到应用程序代码中的AndroidManifest.xml中:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
答案 1 :(得分:0)
这似乎是一个问题。请使用IBM MobileFirst打开PMR以接收修复程序。