Java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
这个问题是由于我使用的appclition的theme不能兼容android.support.design.widget.TabLayout的theme引起的,把app的theme改成Theme.AppCompat.Light.NoActionBar就没有报这个错了。