java.lang.NullPointerException: Attempt to invoke virtual method ‘java.io.File android.content.Context.getFilesDir()’ on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via sinch.com by Unknown author, 1 year ago
Attempt to invoke virtual methodjava.io.File android.content.Context.getFilesDir()’ on a null object reference
via Stack Overflow by Caphson
, 2 years ago
Attempt to invoke virtual method 'java.io.File android.content.Context.getFilesDir()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method ‘java.io.File android.content.Context.getFilesDir()’ on a null object reference
at android.content.ContextWrapper.getFilesDir(ContextWrapper.java:217)
at com.sinch.android.rtc.internal.client.SinchDBPathHelper.getDatabasePath(SinchDBPathHelper.java:31)
at com.sinch.android.rtc.internal.client.SinchDBPathHelper.getPathForInstantMessagingDatabase(SinchDBPathHelper.java:24)
at com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClientFactory.java:16)
at com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
at com.mazeworks.depot.MainActivity.(MainActivity.java:42)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1684)
at android.app.Instrumentation.newActivity(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2954)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Users with the same issue

31 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.