Status Update
Comments
ch...@google.com <ch...@google.com>
ta...@planner5d.com <ta...@planner5d.com> #2
I am getting the same problem after the latest update...
ih...@gmail.com <ih...@gmail.com> #3
I think this might be the same as issue 36949180 . As mentioned in the comments there, try:
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
As a temporary workaround, try turning off Preferences > Compiler > Use External Build.
ih...@gmail.com <ih...@gmail.com> #4
Deleting the out folder before rebuilding solves the problem
ch...@google.com <ch...@google.com> #5
turning off Preferences > Compiler > Use External Build doesn't work if you have other modules as dependencies.
[Deleted User] <[Deleted User]> #6
I'm having the same problem.
jo...@gmail.com <jo...@gmail.com> #7
Same issue here
jo...@gmail.com <jo...@gmail.com> #8
Also having this problem, but turning off Preferences > Compiler > Use External Build worked for me, even though I have other modules as dependencies, despite what jai.chan mentioned.
br...@gmail.com <br...@gmail.com> #9
[Comment deleted]
pi...@googlemail.com <pi...@googlemail.com> #11
Also having the same problem.But I don't know How can I fix ?
gl...@gmail.com <gl...@gmail.com> #12
The problem is still there... :s
[Deleted User] <[Deleted User]> #13
having the same issue here too
ch...@google.com <ch...@google.com> #14
Still happens
Description
In TabLayout there's
private static final Pools.Pool<Tab> sTabPool = new Pools.SynchronizedPool<>(16);
When it tries to reuse Tabs from this Pool it can crash
Caused by: java.lang.IllegalArgumentException: Tab belongs to a different TabLayout.
at android.support.design.widget.TabLayout.addTab(TabLayout.java:433)
at android.support.design.widget.TabLayout.populateFromPagerAdapter(TabLayout.java:772)
at android.support.design.widget.TabLayout.setPagerAdapter(TabLayout.java:763)
at android.support.design.widget.TabLayout.setupWithViewPager(TabLayout.java:715)
at org.jonathancaryl.tablayouttest.MainActivity.onCreate(MainActivity.java:53)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
It looks like the mParent inside the Tab isn't cleared in the reset() method, so if the TabLayout changes (e.g. the Activity is destroyed and recreated) then it throws the IllegalArgumentException.