java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException

Appcelerator JIRA | Shawn Lipscomb | 5 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    h4.Problem If you leave off the *offset* property of elements in the *colors* array of a Gradient, the app crashes. h4.Expected behavior First element of the *colors* array should default to offset:0.0, and the second element of the *colors* array should default to offset:1.0, as this is a common case (full width or height gradient). Alternatively, a console error or "red & white error screen" should be produced when the *offset* property is not specified. h4.Actual bahavior A "force close" occurs with this crash error in the console log: {panel:title=console log} {code} [ERROR][TiApplication( 526)] (main) [104,104] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException; Titanium 2.1.0,2012/06/28 12:16,6e3cab6 [ERROR][TiApplication( 526)] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException [ERROR][TiApplication( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) [ERROR][TiApplication( 526)] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) [ERROR][TiApplication( 526)] at android.app.ActivityThread.access$2300(ActivityThread.java:125) [ERROR][TiApplication( 526)] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) [ERROR][TiApplication( 526)] at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR][TiApplication( 526)] at android.os.Looper.loop(Looper.java:123) [ERROR][TiApplication( 526)] at android.app.ActivityThread.main(ActivityThread.java:4627) [ERROR][TiApplication( 526)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][TiApplication( 526)] at java.lang.reflect.Method.invoke(Method.java:521) [ERROR][TiApplication( 526)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [ERROR][TiApplication( 526)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [ERROR][TiApplication( 526)] at dalvik.system.NativeStart.main(Native Method) [ERROR][TiApplication( 526)] Caused by: java.lang.NullPointerException [ERROR][TiApplication( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:432) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:462) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.loadColors(TiGradientDrawable.java:106) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.<init>(TiGradientDrawable.java:83) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:824) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:594) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:884) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:441) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:433) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:411) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:527) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:204) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:111) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) [ERROR][TiApplication( 526)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:365) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:350) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:235) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:262) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:187) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:605) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.TiUIActivityWindow.windowCreated(TiUIActivityWindow.java:142) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:31) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:352) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:425) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22) [ERROR][TiApplication( 526)] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) [ERROR][TiApplication( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) [ERROR][TiApplication( 526)] ... 11 more [ERROR][AndroidRuntime( 526)] FATAL EXCEPTION: main [ERROR][AndroidRuntime( 526)] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.access$2300(ActivityThread.java:125) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) [ERROR][AndroidRuntime( 526)] at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR][AndroidRuntime( 526)] at android.os.Looper.loop(Looper.java:123) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.main(ActivityThread.java:4627) [ERROR][AndroidRuntime( 526)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][AndroidRuntime( 526)] at java.lang.reflect.Method.invoke(Method.java:521) [ERROR][AndroidRuntime( 526)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [ERROR][AndroidRuntime( 526)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [ERROR][AndroidRuntime( 526)] at dalvik.system.NativeStart.main(Native Method) [ERROR][AndroidRuntime( 526)] Caused by: java.lang.NullPointerException [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:432) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:462) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.loadColors(TiGradientDrawable.java:106) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.<init>(TiGradientDrawable.java:83) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:824) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:594) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:884) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:441) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:433) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:411) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:527) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:204) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:111) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) [ERROR][AndroidRuntime( 526)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:365) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:350) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:235) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:262) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:187) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:605) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.TiUIActivityWindow.windowCreated(TiUIActivityWindow.java:142) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:31) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:352) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:425) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22) [ERROR][AndroidRuntime( 526)] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) [ERROR][AndroidRuntime( 526)] ... 11 more [WARN][ActivityManager( 60)] Force finishing activity com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity {code} {panel} h4.Testcase Run the following code. A white-to-red vertical gradient box should appear at the top of the screen, but instead the app crashes. Now uncomment the offset code. The box appears with the correct gradient. {panel:title=app.js} {code} var win1=Ti.UI.createWindow({ layout:'vertical', backgroundColor:'gray', exitOnClose:true, navBarHidden:true }); var view1=Ti.UI.createView({ height:100, width:100, backgroundGradient:{type:'linear', endPoint:{ x:0, y:'100%' }, colors:[ {color:'white' /*, offset:0.0*/ }, {color:'red' /*, offset:1.0*/ } ]} }); win1.add(view1); win1.open(); {code} {panel}

    Appcelerator JIRA | 5 years ago | Shawn Lipscomb
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException
  2. 0

    h4.Problem If you leave off the *offset* property of elements in the *colors* array of a Gradient, the app crashes. h4.Expected behavior First element of the *colors* array should default to offset:0.0, and the second element of the *colors* array should default to offset:1.0, as this is a common case (full width or height gradient). Alternatively, a console error or "red & white error screen" should be produced when the *offset* property is not specified. h4.Actual bahavior A "force close" occurs with this crash error in the console log: {panel:title=console log} {code} [ERROR][TiApplication( 526)] (main) [104,104] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException; Titanium 2.1.0,2012/06/28 12:16,6e3cab6 [ERROR][TiApplication( 526)] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException [ERROR][TiApplication( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) [ERROR][TiApplication( 526)] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) [ERROR][TiApplication( 526)] at android.app.ActivityThread.access$2300(ActivityThread.java:125) [ERROR][TiApplication( 526)] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) [ERROR][TiApplication( 526)] at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR][TiApplication( 526)] at android.os.Looper.loop(Looper.java:123) [ERROR][TiApplication( 526)] at android.app.ActivityThread.main(ActivityThread.java:4627) [ERROR][TiApplication( 526)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][TiApplication( 526)] at java.lang.reflect.Method.invoke(Method.java:521) [ERROR][TiApplication( 526)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [ERROR][TiApplication( 526)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [ERROR][TiApplication( 526)] at dalvik.system.NativeStart.main(Native Method) [ERROR][TiApplication( 526)] Caused by: java.lang.NullPointerException [ERROR][TiApplication( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:432) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:462) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.loadColors(TiGradientDrawable.java:106) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.<init>(TiGradientDrawable.java:83) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:824) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:594) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:884) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:441) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:433) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:411) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:527) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:204) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:111) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) [ERROR][TiApplication( 526)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:365) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:350) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:235) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:262) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:187) [ERROR][TiApplication( 526)] at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:605) [ERROR][TiApplication( 526)] at ti.modules.titanium.ui.TiUIActivityWindow.windowCreated(TiUIActivityWindow.java:142) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:31) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:352) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:425) [ERROR][TiApplication( 526)] at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22) [ERROR][TiApplication( 526)] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) [ERROR][TiApplication( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) [ERROR][TiApplication( 526)] ... 11 more [ERROR][AndroidRuntime( 526)] FATAL EXCEPTION: main [ERROR][AndroidRuntime( 526)] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.access$2300(ActivityThread.java:125) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) [ERROR][AndroidRuntime( 526)] at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR][AndroidRuntime( 526)] at android.os.Looper.loop(Looper.java:123) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.main(ActivityThread.java:4627) [ERROR][AndroidRuntime( 526)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][AndroidRuntime( 526)] at java.lang.reflect.Method.invoke(Method.java:521) [ERROR][AndroidRuntime( 526)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [ERROR][AndroidRuntime( 526)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [ERROR][AndroidRuntime( 526)] at dalvik.system.NativeStart.main(Native Method) [ERROR][AndroidRuntime( 526)] Caused by: java.lang.NullPointerException [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:432) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:462) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.loadColors(TiGradientDrawable.java:106) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiGradientDrawable.<init>(TiGradientDrawable.java:83) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:824) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:594) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:884) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:441) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:433) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:411) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:527) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:204) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:111) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) [ERROR][AndroidRuntime( 526)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:365) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:350) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:235) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:262) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:187) [ERROR][AndroidRuntime( 526)] at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:605) [ERROR][AndroidRuntime( 526)] at ti.modules.titanium.ui.TiUIActivityWindow.windowCreated(TiUIActivityWindow.java:142) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:31) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:352) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:425) [ERROR][AndroidRuntime( 526)] at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22) [ERROR][AndroidRuntime( 526)] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) [ERROR][AndroidRuntime( 526)] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) [ERROR][AndroidRuntime( 526)] ... 11 more [WARN][ActivityManager( 60)] Force finishing activity com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity {code} {panel} h4.Testcase Run the following code. A white-to-red vertical gradient box should appear at the top of the screen, but instead the app crashes. Now uncomment the offset code. The box appears with the correct gradient. {panel:title=app.js} {code} var win1=Ti.UI.createWindow({ layout:'vertical', backgroundColor:'gray', exitOnClose:true, navBarHidden:true }); var view1=Ti.UI.createView({ height:100, width:100, backgroundGradient:{type:'linear', endPoint:{ x:0, y:'100%' }, colors:[ {color:'white' /*, offset:0.0*/ }, {color:'red' /*, offset:1.0*/ } ]} }); win1.add(view1); win1.open(); {code} {panel}

    Appcelerator JIRA | 5 years ago | Shawn Lipscomb
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eCotton.GradientTest/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.appcelerator.titanium.util.TiConvert.toFloat()
    2. org.appcelerator.titanium
      TiUIView.processProperties
      1. org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:432)[AndroidRuntime( 526)]
      2. org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:462)[AndroidRuntime( 526)]
      3. org.appcelerator.titanium.view.TiGradientDrawable.loadColors(TiGradientDrawable.java:106)[AndroidRuntime( 526)]
      4. org.appcelerator.titanium.view.TiGradientDrawable.<init>(TiGradientDrawable.java:83)[AndroidRuntime( 526)]
      5. org.appcelerator.titanium.view.TiUIView.handleBackgroundImage(TiUIView.java:824)[AndroidRuntime( 526)]
      6. org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:594)[AndroidRuntime( 526)]
      6 frames
    3. ti.modules.titanium
      TiView.processProperties
      1. ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49)[AndroidRuntime( 526)]
      1 frame
    4. org.appcelerator.kroll
      KrollProxy.setModelListener
      1. org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:884)[AndroidRuntime( 526)]
      1 frame
    5. org.appcelerator.titanium
      TiWindowProxy.handleMessage
      1. org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:441)[AndroidRuntime( 526)]
      2. org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:433)[AndroidRuntime( 526)]
      3. org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:411)[AndroidRuntime( 526)]
      4. org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:527)[AndroidRuntime( 526)]
      5. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:204)[AndroidRuntime( 526)]
      6. org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:111)[AndroidRuntime( 526)]
      6 frames
    6. ti.modules.titanium
      ActivityWindowProxy.handleMessage
      1. ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93)[AndroidRuntime( 526)]
      1 frame
    7. Android Platform
      Handler.dispatchMessage
      1. android.os.Handler.dispatchMessage(Handler.java:95)[AndroidRuntime( 526)]
      1 frame
    8. org.appcelerator.kroll
      KrollProxy.fireSyncEvent
      1. org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:365)[AndroidRuntime( 526)]
      2. org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:350)[AndroidRuntime( 526)]
      3. org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:235)[AndroidRuntime( 526)]
      4. org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:262)[AndroidRuntime( 526)]
      5. org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:187)[AndroidRuntime( 526)]
      6. org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:605)[AndroidRuntime( 526)]
      6 frames
    9. ti.modules.titanium
      TiUIActivityWindow.windowCreated
      1. ti.modules.titanium.ui.TiUIActivityWindow.windowCreated(TiUIActivityWindow.java:142)[AndroidRuntime( 526)]
      1 frame
    10. org.appcelerator.titanium
      TiActivity.onCreate
      1. org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:31)[AndroidRuntime( 526)]
      2. org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:352)[AndroidRuntime( 526)]
      3. org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:425)[AndroidRuntime( 526)]
      4. org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:22)[AndroidRuntime( 526)]
      4 frames
    11. Android Platform
      ActivityThread.main
      1. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)[AndroidRuntime( 526)]
      2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)[AndroidRuntime( 526)]
      3. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)[AndroidRuntime( 526)]
      4. android.app.ActivityThread.access$2300(ActivityThread.java:125)[AndroidRuntime( 526)]
      5. android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)[AndroidRuntime( 526)]
      6. android.os.Handler.dispatchMessage(Handler.java:99)[AndroidRuntime( 526)]
      7. android.os.Looper.loop(Looper.java:123)[AndroidRuntime( 526)]
      8. android.app.ActivityThread.main(ActivityThread.java:4627)[AndroidRuntime( 526)]
      8 frames
    12. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)[AndroidRuntime( 526)]
      2. java.lang.reflect.Method.invoke(Method.java:521)[AndroidRuntime( 526)]
      2 frames
    13. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)[AndroidRuntime( 526)]
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)[AndroidRuntime( 526)]
      2 frames
    14. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)[AndroidRuntime( 526)]
      1 frame