java.lang.IllegalStateException

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.

  • Problem: The APIDocs do not say that [Titanium.UI.Window|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object] cannot be added to other views on Android. For example, the following will work on iOS, but will break on Android: {code:lang=javascript} <code class= "javascript">var outer = Ti.UI.createWindow({ backgroundColor: 'white' }); var inner = Ti.UI.createWindow({ backgroundColor: 'blue', top: 50 }); outer.add(inner); outer.open(); {code} When it breaks on Android, it results in the following error: {code} [TRACE] E/AndroidRuntime( 419): FATAL EXCEPTION: main [TRACE] E/AndroidRuntime( 419): java.lang.IllegalStateException: call to getView on a Window [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57) [TRACE] E/AndroidRuntime( 419): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377) [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64) [TRACE] E/AndroidRuntime( 419): at android.os.Handler.dispatchMessage(Handler.java:95) [TRACE] E/AndroidRuntime( 419): at android.os.Looper.loop(Looper.java:123) [TRACE] E/AndroidRuntime( 419): at android.app.ActivityThread.main(ActivityThread.java:4627) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invokeNative(Native Method) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invoke(Method.java:521) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [TRACE] E/AndroidRuntime( 419): at dalvik.system.NativeStart.main(Native Method)</code> {code} Associated Helpdesk Ticket [http://developer.appcelerator.com/helpdesk/view/68881">http://developer.appcelerator.com/helpdesk/view/68881]
    via by Dawson Toth,
  • Problem: The APIDocs do not say that [Titanium.UI.Window|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object] cannot be added to other views on Android. For example, the following will work on iOS, but will break on Android: {code:lang=javascript} <code class= "javascript">var outer = Ti.UI.createWindow({ backgroundColor: 'white' }); var inner = Ti.UI.createWindow({ backgroundColor: 'blue', top: 50 }); outer.add(inner); outer.open(); {code} When it breaks on Android, it results in the following error: {code} [TRACE] E/AndroidRuntime( 419): FATAL EXCEPTION: main [TRACE] E/AndroidRuntime( 419): java.lang.IllegalStateException: call to getView on a Window [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57) [TRACE] E/AndroidRuntime( 419): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377) [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64) [TRACE] E/AndroidRuntime( 419): at android.os.Handler.dispatchMessage(Handler.java:95) [TRACE] E/AndroidRuntime( 419): at android.os.Looper.loop(Looper.java:123) [TRACE] E/AndroidRuntime( 419): at android.app.ActivityThread.main(ActivityThread.java:4627) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invokeNative(Native Method) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invoke(Method.java:521) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [TRACE] E/AndroidRuntime( 419): at dalvik.system.NativeStart.main(Native Method)</code> {code} Associated Helpdesk Ticket [http://developer.appcelerator.com/helpdesk/view/68881">http://developer.appcelerator.com/helpdesk/view/68881]
    via by Dawson Toth,
    • java.lang.IllegalStateException: call to getView on a Window at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57) at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377) at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    No Bugmate found.