Skip to main content

ImageProcessor creation fails with java.lang.NullPointerException

Article # 3035465 - Page views: 22


When attempting to invoke the ImageProcessor constructor in our implementation, we are getting the following exception thrown:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference



In the source code for Android the customer wrote:

imageProcessor = new ImageProcessor();

and it failed with the reported error.

If you check the sample application ImageProcessor then you will see that you need to set the AppContextProvider before using the image processor like this:

protected void onCreate(Bundle savedInstanceState) {
// Initializing the SDK

Afterwards it was working.


Level of Complexity 



Applies to  

Product Version Build Environment Hardware
Kofax Mobile SDK all      



Add any references to other internal or external articles



Article # 3035465
  • Was this article helpful?