Closed Sarun1001 closed 7 years ago
@Sarun1001 what version of lib or commit do you use?
@kot331107 - Version 1.4.1
I'll check it and return to you later
Thank you
hello, any idea guys
I am having this same problem except mine crashes every time. The app opens, list loads with ads loading and then crashes.
I fixed mine by changing the listview width and height from wrap_content to match_parent
<ListView android:id="@+id/listView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" />
@HaydenCampbell could you please reproduce that crash once more and post your LogCat here? thx in advance
Sure can, just changed listview width and height back to wrap_content and it causes the crash:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.package, PID: 2313 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:4659) at android.view.ViewGroup.addView(ViewGroup.java:4500) at android.view.ViewGroup.addView(ViewGroup.java:4440) at android.view.ViewGroup.addView(ViewGroup.java:4413) at com.clockbyte.admobadapter.expressads.AdmobExpressAdapterWrapper.getView(AdmobExpressAdapterWrapper.java:335) at android.widget.AbsListView.obtainView(AbsListView.java:3251) at android.widget.ListView.measureHeightOfChildren(ListView.java:1396) at android.widget.ListView.onMeasure(ListView.java:1303) at android.view.View.measure(View.java:21121) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:714) at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:90) at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1391) at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:784) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:21121) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6462) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:897) at android.view.View.measure(View.java:21121) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2625) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1677) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1928) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1550) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7189) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959) at android.view.Choreographer.doCallbacks(Choreographer.java:734) at android.view.Choreographer.doFrame(Choreographer.java:670) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
fixed
Log---- 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:4449) at android.view.ViewGroup.addView(ViewGroup.java:4285) at android.view.ViewGroup.addView(ViewGroup.java:4226) at android.view.ViewGroup.addView(ViewGroup.java:4199) at com.clockbyte.admobadapter.expressads.AdmobExpressAdapterWrapper.getView(AdmobExpressAdapterWrapper.java:335) at android.widget.AbsListView.obtainView(AbsListView.java:2474) at android.widget.ListView.measureHeightOfChildren(ListView.java:1301) at android.widget.ListView.onMeasure(ListView.java:1203) at android.view.View.measure(View.java:19169) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:825) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:511) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723) at android.widget.LinearLayout.measureVertical(LinearLayout.java:788) at android.widget.LinearLayout.onMeasure(LinearLayout.java:648) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.FrameLayout.onMeasure(FrameLayout.java:223) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.FrameLayout.onMeasure(FrameLayout.java:223) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.FrameLayout.onMeasure(FrameLayout.java:223) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723) at android.widget.LinearLayout.measureVertical(LinearLayout.java:788) at android.widget.LinearLayout.onMeasure(LinearLayout.java:648) at android.view.View.measure(View.java:19169) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124) at android.widget.FrameLayout.onMeasure(FrameLayout.java:223) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2747) at android.view.View.measure(View.java:19169) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2485) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1444) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1698) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1325) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6741) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:912) at android.view.Choreographer.doCallbacks(Choreographer.java:714) at android.view.Choreographer.doFrame(Choreographer.java:649) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:898) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5769) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) 05-11 14:41:10.292 604-612/com.globalaxiomlabs.malayalamtrolls I/System: FinalizerDaemon: finalize objects = 1582
Activity Code---------------
public class CommentsActivity extends AppCompatActivity {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); getWindow().setStatusBarColor((Color.parseColor("#1565C0")));//FF1744 }
Adapter--------------
public class CommentsAdapter extends ArrayAdapter {
}
activity_comments xml-------
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >
activity_comments_row ----------------
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:background="@color/white" android:layout_height="match_parent">
It crashes sometimes when opening comments activity, but works sometimes,
Crash frequency reduced when 'adapterWrapper.setFirstAdIndex(4);' set to an even number
Any idea ??
What actually makes it difficult for me is that crash is not pointing to any specific line of code. I need some expert advice Thank you