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.

  • h3. Problem description Setting 'borderWidth' for a window in a tabGroup crashes the App Not reproducible with TiSDK 2.1.4 GA h3. Steps to reproduce: Start from the KitchenSink BaseUIWindow.js Add borderWidth: 0 in the self (window) definition as follows: {code} function BaseUIWindow(title) { var self = Ti.UI.createWindow({ title:title, backgroundColor:'white', borderWidth : 0 // Add this line }); {code} The app will crash in the simulator and on the device with the following error: {code} [1028,1028] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.; Titanium 3.0.0,2012/12/12 18:49,a5894b3 [ERROR][TiApplication(13705)] java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR][TiApplication(13705)] at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) [ERROR][TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3208) [ERROR][TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3188) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:953) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:697) [ERROR][TiApplication(13705)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][TiApplication(13705)] at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:893) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:310) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:107) [ERROR][TiApplication(13705)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiApplication(13705)] at android.os.Looper.loop(Looper.java:137) [ERROR][TiApplication(13705)] at android.app.ActivityThread.main(ActivityThread.java:4514) [ERROR][TiApplication(13705)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][TiApplication(13705)] at java.lang.reflect.Method.invoke(Method.java:511) [ERROR][TiApplication(13705)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) [ERROR][TiApplication(13705)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) [ERROR][TiApplication(13705)] at dalvik.system.NativeStart.main(Native Method) {code}
    via by Federico Casali,
  • h3. Problem description Setting 'borderWidth' for a window in a tabGroup crashes the App Not reproducible with TiSDK 2.1.4 GA h3. Steps to reproduce: Start from the KitchenSink BaseUIWindow.js Add borderWidth: 0 in the self (window) definition as follows: {code} function BaseUIWindow(title) { var self = Ti.UI.createWindow({ title:title, backgroundColor:'white', borderWidth : 0 // Add this line }); {code} The app will crash in the simulator and on the device with the following error: {code} [1028,1028] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.; Titanium 3.0.0,2012/12/12 18:49,a5894b3 [ERROR][TiApplication(13705)] java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR][TiApplication(13705)] at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) [ERROR][TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3208) [ERROR][TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3188) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:953) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:697) [ERROR][TiApplication(13705)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49) [ERROR][TiApplication(13705)] at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:893) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:310) [ERROR][TiApplication(13705)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:107) [ERROR][TiApplication(13705)] at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR][TiApplication(13705)] at android.os.Looper.loop(Looper.java:137) [ERROR][TiApplication(13705)] at android.app.ActivityThread.main(ActivityThread.java:4514) [ERROR][TiApplication(13705)] at java.lang.reflect.Method.invokeNative(Native Method) [ERROR][TiApplication(13705)] at java.lang.reflect.Method.invoke(Method.java:511) [ERROR][TiApplication(13705)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) [ERROR][TiApplication(13705)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) [ERROR][TiApplication(13705)] at dalvik.system.NativeStart.main(Native Method) {code}
    via by Federico Casali,
  • AlertDialog after AlertDialog
    via Stack Overflow by Styler2go
    ,
  • +Test Code+: //FirstView Component Constructor var flag = false; function FirstView(win) { // Create a Button. var showHideButton = Ti.UI.createButton({ title : 'Show / Hide', height : 75, width : '100%', top : 0, left : 0 }); // Listen for click events. showHideButton.addEventListener('click', function() { if(true == flag) { win.add(self); flag = false; } else { win.remove(self); flag = true; } }); // Add to the parent view. win.add(showHideButton); var self = Ti.UI.createView({ top : 100, left : 0 }); win.add(self); var sb = Titanium.UI.createSearchBar({ barColor : '#122a6f', showCancel : false, height : 44, }); // Create a TableView. var aTableView = Ti.UI.createTableView({ height : 600, width : '100%', search : sb, top : 0, left : 0 }); // Populate the TableView data. var data = [ {title:'Row 1', hasChild:true, color:'red', header:'First'}, {title:'Row 2', hasDetail:true, color:'green'}, {title:'Row 3', hasCheck:true, color:'blue', header:'Second'}, {title:'Row 4', color:'orange'} ]; aTableView.setData(data); // Listen for click events. aTableView.addEventListener('click', function(e) { alert('title: \'' + e.row.title + '\', section: \'' + e.section.headerTitle + '\', index: ' + e.index); }); // Add to the parent view. self.add(aTableView); return self; } module.exports = FirstView; +Test Case+: 1. Launch the application 2. Press the hide / show button to hide the table. 3. Press it again to show the table. +Expected behavior+: The table should get displayed again. +Actual Behavior+: The application crashes with the following ADB log: D/AndroidRuntime( 3890): Shutting down VM W/dalvikvm( 3890): threadid=1: thread exiting with uncaught exception (group=0x40c451f8) E/TiApplication( 3890): (main) [6288,6382] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The specified child already has a p t. You must call removeView() on the child's parent first.; Titanium 1.8.2,2012/02/23 17:46,59b3a90 E/TiApplication( 3890): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/TiApplication( 3890): at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) E/TiApplication( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3208) E/TiApplication( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3188) E/TiApplication( 3890): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/TiApplication( 3890): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:471) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:109) E/TiApplication( 3890): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:94) E/TiApplication( 3890): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 3890): at android.os.Looper.loop(Looper.java:137) E/TiApplication( 3890): at android.app.ActivityThread.main(ActivityThread.java:4507) E/TiApplication( 3890): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 3890): at java.lang.reflect.Method.invoke(Method.java:511) E/TiApplication( 3890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) E/TiApplication( 3890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) E/TiApplication( 3890): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 3890): FATAL EXCEPTION: main E/AndroidRuntime( 3890): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/AndroidRuntime( 3890): at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) E/AndroidRuntime( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3208) E/AndroidRuntime( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3188) E/AndroidRuntime( 3890): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/AndroidRuntime( 3890): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:471) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:109) E/AndroidRuntime( 3890): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:94) E/AndroidRuntime( 3890): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 3890): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 3890): at android.app.ActivityThread.main(ActivityThread.java:4507) E/AndroidRuntime( 3890): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3890): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 3890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) E/AndroidRuntime( 3890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) E/AndroidRuntime( 3890): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 1985): Force finishing activity r.intent.getComponent().flattenToShortString() +Others+: The above code works fine if the search bar is removed. +Attachments+: The source code has been attached.
    via by Soumya Kanti Kar,
  • +Test Code+: //FirstView Component Constructor var flag = false; function FirstView(win) { // Create a Button. var showHideButton = Ti.UI.createButton({ title : 'Show / Hide', height : 75, width : '100%', top : 0, left : 0 }); // Listen for click events. showHideButton.addEventListener('click', function() { if(true == flag) { win.add(self); flag = false; } else { win.remove(self); flag = true; } }); // Add to the parent view. win.add(showHideButton); var self = Ti.UI.createView({ top : 100, left : 0 }); win.add(self); var sb = Titanium.UI.createSearchBar({ barColor : '#122a6f', showCancel : false, height : 44, }); // Create a TableView. var aTableView = Ti.UI.createTableView({ height : 600, width : '100%', search : sb, top : 0, left : 0 }); // Populate the TableView data. var data = [ {title:'Row 1', hasChild:true, color:'red', header:'First'}, {title:'Row 2', hasDetail:true, color:'green'}, {title:'Row 3', hasCheck:true, color:'blue', header:'Second'}, {title:'Row 4', color:'orange'} ]; aTableView.setData(data); // Listen for click events. aTableView.addEventListener('click', function(e) { alert('title: \'' + e.row.title + '\', section: \'' + e.section.headerTitle + '\', index: ' + e.index); }); // Add to the parent view. self.add(aTableView); return self; } module.exports = FirstView; +Test Case+: 1. Launch the application 2. Press the hide / show button to hide the table. 3. Press it again to show the table. +Expected behavior+: The table should get displayed again. +Actual Behavior+: The application crashes with the following ADB log: D/AndroidRuntime( 3890): Shutting down VM W/dalvikvm( 3890): threadid=1: thread exiting with uncaught exception (group=0x40c451f8) E/TiApplication( 3890): (main) [6288,6382] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The specified child already has a p t. You must call removeView() on the child's parent first.; Titanium 1.8.2,2012/02/23 17:46,59b3a90 E/TiApplication( 3890): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/TiApplication( 3890): at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) E/TiApplication( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3208) E/TiApplication( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3188) E/TiApplication( 3890): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/TiApplication( 3890): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:471) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) E/TiApplication( 3890): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:109) E/TiApplication( 3890): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:94) E/TiApplication( 3890): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 3890): at android.os.Looper.loop(Looper.java:137) E/TiApplication( 3890): at android.app.ActivityThread.main(ActivityThread.java:4507) E/TiApplication( 3890): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 3890): at java.lang.reflect.Method.invoke(Method.java:511) E/TiApplication( 3890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) E/TiApplication( 3890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) E/TiApplication( 3890): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 3890): FATAL EXCEPTION: main E/AndroidRuntime( 3890): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/AndroidRuntime( 3890): at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) E/AndroidRuntime( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3208) E/AndroidRuntime( 3890): at android.view.ViewGroup.addView(ViewGroup.java:3188) E/AndroidRuntime( 3890): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/AndroidRuntime( 3890): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:471) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) E/AndroidRuntime( 3890): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:109) E/AndroidRuntime( 3890): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:94) E/AndroidRuntime( 3890): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 3890): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 3890): at android.app.ActivityThread.main(ActivityThread.java:4507) E/AndroidRuntime( 3890): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3890): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 3890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) E/AndroidRuntime( 3890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) E/AndroidRuntime( 3890): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 1985): Force finishing activity r.intent.getComponent().flattenToShortString() +Others+: The above code works fine if the search bar is removed. +Attachments+: The source code has been attached.
    via by Soumya Kanti Kar,
    • java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:3337)[TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3208)[TiApplication(13705)] at android.view.ViewGroup.addView(ViewGroup.java:3188)[TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:953)[TiApplication(13705)] at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:697)[TiApplication(13705)] at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:49)[TiApplication(13705)] at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:893)[TiApplication(13705)] at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:310)[TiApplication(13705)] at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:107)[TiApplication(13705)] at android.os.Handler.dispatchMessage(Handler.java:95)[TiApplication(13705)] at android.os.Looper.loop(Looper.java:137)[TiApplication(13705)] at android.app.ActivityThread.main(ActivityThread.java:4514)[TiApplication(13705)] at java.lang.reflect.Method.invokeNative(Native Method)[TiApplication(13705)] at java.lang.reflect.Method.invoke(Method.java:511)[TiApplication(13705)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)[TiApplication(13705)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)[TiApplication(13705)] at dalvik.system.NativeStart.main(Native Method)

    Users with the same issue

    filpgamefilpgame
    2 times, last one,
    Indri YunitaIndri Yunita
    6 times, last one,
    kuldeepkuldeep
    5 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    harshaharsha
    1 times, last one,
    18 more bugmates