java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • How can I call admob Interstitial
    via Stack Overflow by Erdem Azaklı
    ,
  • Android System: How can I call admob Interstitial
    via by Unknown author,
  • Hi. I'm experiencing random crashes on Android devices. It's hard to reproduce issue and create test app because it happens randomly, but here are crash logs: {code} 12-10 16:32:00.844: E/AndroidRuntime(10491): java.lang.NullPointerException 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.view.ViewConfiguration.get(ViewConfiguration.java:333) 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.view.View.<init>(View.java:3571) 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.view.ViewGroup.<init>(ViewGroup.java:469) 12-10 16:32:00.844: E/AndroidRuntime(10491): at ti.modules.titanium.ui.widget.TiImageView.<init>(TiImageView.java:70) 12-10 16:32:00.844: E/AndroidRuntime(10491): at ti.modules.titanium.ui.widget.TiImageView.<init>(TiImageView.java:160) 12-10 16:32:00.844: E/AndroidRuntime(10491): at ti.modules.titanium.ui.widget.TiUIImageView.<init>(TiUIImageView.java:95) 12-10 16:32:00.844: E/AndroidRuntime(10491): at ti.modules.titanium.ui.ImageViewProxy.createView(ImageViewProxy.java:43) 12-10 16:32:00.844: E/AndroidRuntime(10491): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:493) 12-10 16:32:00.844: E/AndroidRuntime(10491): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:235) 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.os.Handler.dispatchMessage(Handler.java:98) 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.os.Looper.loop(Looper.java:146) 12-10 16:32:00.844: E/AndroidRuntime(10491): at android.app.ActivityThread.main(ActivityThread.java:5602) 12-10 16:32:00.844: E/AndroidRuntime(10491): at java.lang.reflect.Method.invokeNative(Native Method) 12-10 16:32:00.844: E/AndroidRuntime(10491): at java.lang.reflect.Method.invoke(Method.java:515) 12-10 16:32:00.844: E/AndroidRuntime(10491): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) 12-10 16:32:00.844: E/AndroidRuntime(10491): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) 12-10 16:32:00.844: E/AndroidRuntime(10491): at dalvik.system.NativeStart.main(Native Method) 12-10 16:32:01.164: E/android.os.Debug(574): !@Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error {code} I did some research, it seems issue does not happen on TiSDK 5.1.1.GA, but happens on 5.3.0.GA, 5.5.1.GA and 6.0.0.GA. If you need more info, please let me know. Thanks.
    via by Ivan Skugor,
  • getResources() return an error
    via Stack Overflow by J. Arnold
    ,
    • java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at android.content.ContextWrapper.getResources(ContextWrapper.java:85) at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:74) at android.view.View.<init>(View.java:3578) at android.view.View.<init>(View.java:3683) at android.view.ViewGroup.<init>(ViewGroup.java:492) at android.view.ViewGroup.<init>(ViewGroup.java:488) at com.google.android.youtube.player.YouTubePlayerView.<init>(Unknown Source) at com.google.android.youtube.player.YouTubePlayerView.<init>(Unknown Source) at com.google.android.youtube.player.YouTubePlayerView.<init>(Unknown Source) at com.google.android.youtube.player.YouTubePlayerView.<init>(Unknown Source) at com.earlystart.youtube.YoutubeView$1.run(YoutubeView.java:32) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5351) 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:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

    Users with the same issue

    Sunny Kumar Aditya
    Sunny Kumar Aditya1 times, last one,
    Unknown visitor3 times, last one,
    Indri Yunita
    Indri Yunita5 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    6 more bugmates