Skip to content

App Crashes when calling tabLayout.setUpWithAdapter(builder.build()) #3

@MuhammadSulaiman001

Description

@MuhammadSulaiman001

This is my kotlin code:


val viewPager = findViewById<View>(R.id.viewpager) as ViewPager
        setupViewPager(viewPager)

val tabLayout = findViewById<View>(R.id.tablayout) as FunTabLayout
val builder =
    BubbleTabAdapter.Builder(this).setViewPager(viewPager).setTabPadding(24, 24, 24, 24)
        .setTabIndicatorColor(Color.parseColor("#ffa022"))
        .setTabBackgroundResId(R.drawable.ripple).setIconFetcher(this)
        .setIconDimension(
            50
        )
        .setTabTextAppearance(R.style.BubbleTabText)
tabLayout.setUpWithAdapter(builder.build())

I have taken this snippet from the demo app in this repo. The error message is

java.lang.IllegalAccessError: Illegal class access: 'com.example.ui.MainActivity' attempting to access 'com.tompee.funtablayout.BaseAdapter' (declaration of 'com.example.ui.MainActivity' appears in /data/app/com.example-nljI2D-kMBoReq4uEtCeFg==/base.apk!classes2.dex)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions