Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

java.lang.NullPointerException on TiUIActivityIndicator.setStyle(TiUIActivityIndicator.java:164)

$
0
0

Hello Folks,

I currently have an application in the google play store and recevied a crash with the following stacktrace:

java.lang.NullPointerException
at ti.modules.titanium.ui.widget.TiUIActivityIndicator.setStyle(TiUIActivityIndicator.java:164)
at ti.modules.titanium.ui.widget.TiUIActivityIndicator.processProperties(TiUIActivityIndicator.java:86)
at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1185)
at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:480)
at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471)
at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449)
at ti.modules.titanium.ui.ActivityIndicatorProxy.handleHide(ActivityIndicatorProxy.java:94)
at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:241)
at ti.modules.titanium.ui.ActivityIndicatorProxy.handleMessage(ActivityIndicatorProxy.java:67)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Checking https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIActivityIndicator.java#L164, the code goes wrong on view.removeAllViews().

This indicates that the view equals null. When you check the class' properties, the view refers to a LinearLayout, which means the LinearLayout, where the message and indicator are wrapped in, is null.

In my application I have a few activity indicators, but always defined like:

var indicator = Ti.UI.createActivityIndicator({
    style:  Ti.Android ? Ti.UI.ActivityIndicatorStyle.BIG_DARK : Ti.UI.iPhone.ActivityIndicatorStyle.DARK,
    width:  100,    
    height: 100,
    message: " Loading.."   
});
Any idea what the error is causing? I can't reproduce it myself on the devices I test with.

Specs:

  • Android Version: 4.2
  • Android Device: ASUS MeMO Pad Smart 10 (ME301T)
  • Ti.SDK: 3.2.3 GA

Thanks in advance, Patrick van Vuuren


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>