java.lang.RuntimeException

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.

  • App crashes if we use the searchBar properties borderRadius, borderColor, or borderWidth. And use this searchBar in a tableView using search property. h3.Testing Environment: Titanium SDK: 3.3.0.GA, 3.2.3.GA Titanium CLI: 3.3.0, Android SDK: 4.2.2, 4.4.2 OS X Version: 10.9.3, Appcelerator Studio: 3.3.0 h3.Steps to Reproduce the issue: 1. Create classic project. 2. Paste this code app.js file. 3. Run this code with the testing environment. h3.Test Code {code:title=app.js} var win = Titanium.UI.createWindow({ title : "search bar" }); // create table view data object var data = []; data[0] = Ti.UI.createTableViewRow({ hasChild : true, title : 'Row 1' }); data[1] = Ti.UI.createTableViewRow({ hasDetail : true, title : 'Row 2' }); data[2] = Ti.UI.createTableViewRow({ hasCheck : true, title : 'Row 3' }); data[3] = Ti.UI.createTableViewRow({ title : 'Row 4' }); var search = Titanium.UI.createSearchBar({ borderRadius : 10, borderColor : 'red', borderWidth : 2, showCancel : true, height : 60, hintText : "Filter results", }); // create table view var tableview = Titanium.UI.createTableView({ data : data, top : 40, search : search, filterAttribute : "title", }); win.add(tableview); win.open(); {code} {code:title=application log} [ERROR] : TiApplication: (main) [107,107] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bd.apptest1/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bd.apptest1/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) [ERROR] : TiApplication: at android.app.ActivityThread.access$600(ActivityThread.java:141) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5041) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR] : TiApplication: at android.view.ViewGroup.addViewInner(ViewGroup.java:3339) [ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3210) [ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3186) [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:155) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1185) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:480) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:487) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:566) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:544) [ERROR] : TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:303) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:452) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:528) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:5104) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) [ERROR] : TiApplication: ... 11 more {code} Thanks
    via by Motiur Rahman,
  • App crashes if we use the searchBar properties borderRadius, borderColor, or borderWidth. And use this searchBar in a tableView using search property. h3.Testing Environment: Titanium SDK: 3.3.0.GA, 3.2.3.GA Titanium CLI: 3.3.0, Android SDK: 4.2.2, 4.4.2 OS X Version: 10.9.3, Appcelerator Studio: 3.3.0 h3.Steps to Reproduce the issue: 1. Create classic project. 2. Paste this code app.js file. 3. Run this code with the testing environment. h3.Test Code {code:title=app.js} var win = Titanium.UI.createWindow({ title : "search bar" }); // create table view data object var data = []; data[0] = Ti.UI.createTableViewRow({ hasChild : true, title : 'Row 1' }); data[1] = Ti.UI.createTableViewRow({ hasDetail : true, title : 'Row 2' }); data[2] = Ti.UI.createTableViewRow({ hasCheck : true, title : 'Row 3' }); data[3] = Ti.UI.createTableViewRow({ title : 'Row 4' }); var search = Titanium.UI.createSearchBar({ borderRadius : 10, borderColor : 'red', borderWidth : 2, showCancel : true, height : 60, hintText : "Filter results", }); // create table view var tableview = Titanium.UI.createTableView({ data : data, top : 40, search : search, filterAttribute : "title", }); win.add(tableview); win.open(); {code} {code:title=application log} [ERROR] : TiApplication: (main) [107,107] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bd.apptest1/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bd.apptest1/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) [ERROR] : TiApplication: at android.app.ActivityThread.access$600(ActivityThread.java:141) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5041) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. [ERROR] : TiApplication: at android.view.ViewGroup.addViewInner(ViewGroup.java:3339) [ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3210) [ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3186) [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:155) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1185) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:480) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:487) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:566) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:544) [ERROR] : TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:303) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:452) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:528) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:5104) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) [ERROR] : TiApplication: ... 11 more {code} Thanks
    via by Motiur Rahman,
  • +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,
  • h3. Expected Behavior The app launch, pressing the button shows another window with a search bar in a table, then pushing the hardware back button take us to the first window, then push again the button to open the window with the search bar again, needs to work and open the window with the search bar again h3. Actual Behavior When I push the button to open the search bar window for the second time, the application crash and throw this message: {code} msg:java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first {code} h3. Steps to reproduce - Push the button - use hardware button to go back to the first screen - Push the button again - Crash h3. Test Case {code:title=app.js|borderStyle=solid} var page1 = require("page1"); page1.win.open(); {code} {code:title=page1.js|borderStyle=solid} var win = Ti.UI.createWindow({ backgroundColor:"white", navBarHidden:false }); var button = Ti.UI.createButton({ title:"button" }); win.add(button); var page2 = require("page2"); button.addEventListener('click', function(){ page2.win.open(); }) exports.win = win; {code} {code:title=page2.js|borderStyle=solid} var win = Ti.UI.createWindow({ backgroundColor : "white", navBarHidden : false }); var search = Ti.UI.createSearchBar(); var table = Ti.UI.createTableView({ search:search }); win.add(table); exports.win = win; {code} {code:title=Log|borderStyle=solid} I/ActivityManager( 62): Starting: Intent { cmp=com.appcelerator.app283994/org.appcelerator.titanium.TiActivity (has extras) } from pid 412 D/AndroidRuntime( 412): Shutting down VM W/dalvikvm( 412): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/TiApplication( 412): (main) [2630,9831] 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 1.9.0,2012/01/03 08:46,428293e E/TiApplication( 412): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/TiApplication( 412): at android.view.ViewGroup.addViewInner(ViewGroup.java:1976) E/TiApplication( 412): at android.view.ViewGroup.addView(ViewGroup.java:1871) E/TiApplication( 412): at android.view.ViewGroup.addView(ViewGroup.java:1851) E/TiApplication( 412): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/TiApplication( 412): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456) E/TiApplication( 412): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81) E/TiApplication( 412): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 412): at android.os.Looper.loop(Looper.java:130) E/TiApplication( 412): at android.app.ActivityThread.main(ActivityThread.java:3683) E/TiApplication( 412): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 412): at java.lang.reflect.Method.invoke(Method.java:507) E/TiApplication( 412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/TiApplication( 412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/TiApplication( 412): at dalvik.system.NativeStart.main(Native Method) I/ActivityManager( 62): Displayed com.appcelerator.app283994/org.appcelerator.titanium.TiActivity: +364ms E/AndroidRuntime( 412): FATAL EXCEPTION: main E/AndroidRuntime( 412): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/AndroidRuntime( 412): at android.view.ViewGroup.addViewInner(ViewGroup.java:1976) E/AndroidRuntime( 412): at android.view.ViewGroup.addView(ViewGroup.java:1871) E/AndroidRuntime( 412): at android.view.ViewGroup.addView(ViewGroup.java:1851) E/AndroidRuntime( 412): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/AndroidRuntime( 412): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456) E/AndroidRuntime( 412): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81) E/AndroidRuntime( 412): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 412): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 412): at android.app.ActivityThread.main(ActivityThread.java:3683) E/AndroidRuntime( 412): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 412): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime( 412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/AndroidRuntime( 412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/AndroidRuntime( 412): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 62): Force finishing activity com.appcelerator.app283994/org.appcelerator.titanium.TiActivity {code}
    via by Radamantis Torres-Lechuga,
  • +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,
  • h3. Expected Behavior The app launch, pressing the button shows another window with a search bar in a table, then pushing the hardware back button take us to the first window, then push again the button to open the window with the search bar again, needs to work and open the window with the search bar again h3. Actual Behavior When I push the button to open the search bar window for the second time, the application crash and throw this message: {code} msg:java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first {code} h3. Steps to reproduce - Push the button - use hardware button to go back to the first screen - Push the button again - Crash h3. Test Case {code:title=app.js|borderStyle=solid} var page1 = require("page1"); page1.win.open(); {code} {code:title=page1.js|borderStyle=solid} var win = Ti.UI.createWindow({ backgroundColor:"white", navBarHidden:false }); var button = Ti.UI.createButton({ title:"button" }); win.add(button); var page2 = require("page2"); button.addEventListener('click', function(){ page2.win.open(); }) exports.win = win; {code} {code:title=page2.js|borderStyle=solid} var win = Ti.UI.createWindow({ backgroundColor : "white", navBarHidden : false }); var search = Ti.UI.createSearchBar(); var table = Ti.UI.createTableView({ search:search }); win.add(table); exports.win = win; {code} {code:title=Log|borderStyle=solid} I/ActivityManager( 62): Starting: Intent { cmp=com.appcelerator.app283994/org.appcelerator.titanium.TiActivity (has extras) } from pid 412 D/AndroidRuntime( 412): Shutting down VM W/dalvikvm( 412): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/TiApplication( 412): (main) [2630,9831] 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 1.9.0,2012/01/03 08:46,428293e E/TiApplication( 412): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/TiApplication( 412): at android.view.ViewGroup.addViewInner(ViewGroup.java:1976) E/TiApplication( 412): at android.view.ViewGroup.addView(ViewGroup.java:1871) E/TiApplication( 412): at android.view.ViewGroup.addView(ViewGroup.java:1851) E/TiApplication( 412): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/TiApplication( 412): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427) E/TiApplication( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456) E/TiApplication( 412): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81) E/TiApplication( 412): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 412): at android.os.Looper.loop(Looper.java:130) E/TiApplication( 412): at android.app.ActivityThread.main(ActivityThread.java:3683) E/TiApplication( 412): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 412): at java.lang.reflect.Method.invoke(Method.java:507) E/TiApplication( 412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/TiApplication( 412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/TiApplication( 412): at dalvik.system.NativeStart.main(Native Method) I/ActivityManager( 62): Displayed com.appcelerator.app283994/org.appcelerator.titanium.TiActivity: +364ms E/AndroidRuntime( 412): FATAL EXCEPTION: main E/AndroidRuntime( 412): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. E/AndroidRuntime( 412): at android.view.ViewGroup.addViewInner(ViewGroup.java:1976) E/AndroidRuntime( 412): at android.view.ViewGroup.addView(ViewGroup.java:1871) E/AndroidRuntime( 412): at android.view.ViewGroup.addView(ViewGroup.java:1851) E/AndroidRuntime( 412): at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:131) E/AndroidRuntime( 412): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427) E/AndroidRuntime( 412): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456) E/AndroidRuntime( 412): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81) E/AndroidRuntime( 412): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 412): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 412): at android.app.ActivityThread.main(ActivityThread.java:3683) E/AndroidRuntime( 412): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 412): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime( 412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/AndroidRuntime( 412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/AndroidRuntime( 412): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 62): Force finishing activity com.appcelerator.app283994/org.appcelerator.titanium.TiActivity {code}
    via by Radamantis Torres-Lechuga,
    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bd.apptest1/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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) Caused by: 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:3339) at android.view.ViewGroup.addView(ViewGroup.java:3210) at android.view.ViewGroup.addView(ViewGroup.java:3186) at ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:155) 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 org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:487) at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:471) at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:449) at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:566) at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:544) at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:303) at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:452) at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:528) at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) at android.app.Activity.performCreate(Activity.java:5104) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) ... 11 more

    Users with the same issue

    filpgame
    2 times, last one,
    Indri Yunita
    6 times, last one,
    kuldeep
    5 times, last one,
    Unknown visitor1 times, last one,
    harsha
    1 times, last one,
    18 more bugmates