You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2017/12/23 07:50:00 UTC

[jira] [Resolved] (CB-13696) the camera fails to open to take a picture after suing proguard in android environment

     [ https://issues.apache.org/jira/browse/CB-13696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-13696.
-----------------------------
    Resolution: Won't Fix

It's clear that the FileProvider also has to be added as well for this to work.  We recommend not using ProGuard with Cordova because we can't guarantee that your ProGuard approach will work for all plugins, since the WebView is technically able to be swapped out using a plugin and it uses a different interface.



> the camera fails to open to take a picture after suing proguard in android environment
> --------------------------------------------------------------------------------------
>
>                 Key: CB-13696
>                 URL: https://issues.apache.org/jira/browse/CB-13696
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android
>         Environment: Android
>            Reporter: Mohd Sohel
>            Assignee: Joe Bowser
>            Priority: Critical
>              Labels: android, plug-in
>
> the camera plugin fails to open and generate a null point exception error after we use proguard for the project,
>  the error is as follows
> Uncaught exception from plugin
>                                                                     java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
>                                                                         at android.support.v4.content.FileProvider.b(SourceFile:583)
>                                                                         at android.support.v4.content.FileProvider.a(SourceFile:557)
>                                                                         at android.support.v4.content.FileProvider.a(SourceFile:399)
>                                                                         at org.apache.cordova.camera.CameraLauncher.takePicture(SourceFile:295)
>                                                                         at org.apache.cordova.camera.CameraLauncher.callTakePicture(SourceFile:275)
>                                                                         at org.apache.cordova.camera.CameraLauncher.execute(SourceFile:184)
>                                                                         at org.apache.cordova.CordovaPlugin.execute(SourceFile:98)
>                                                                         at org.apache.cordova.PluginManager.exec(SourceFile:132)
>                                                                         at org.apache.cordova.CordovaBridge.jsExec(SourceFile:57)
>                                                                         at org.apache.cordova.engine.SystemExposedJsApi.exec(SourceFile:41)
>                                                                         at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
>                                                                         at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:9)
>                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
>                                                                         at android.os.Looper.loop(Looper.java:154)
>                                                                         at android.os.HandlerThread.run(HandlerThread.java:61)
> my proguard setting have this lines to keep plugins classses
> -keep public class * extends org.apache.cordova.CordovaPlugin
> -dontwarn org.apache.**



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org