Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes after importing ImageCarousel view element in XML #107

Open
BuktopMKD opened this issue Aug 9, 2023 · 1 comment
Open

App crashes after importing ImageCarousel view element in XML #107

BuktopMKD opened this issue Aug 9, 2023 · 1 comment

Comments

@BuktopMKD
Copy link

Added all dependancyes in build.gradle file. Was following your documentation and added ImageCarousel view element in my layout. After that there is a crash with this log:

FATAL EXCEPTION: main
Process: com.example, PID: 26389
android.view.InflateException: Binary XML file line #11 in com.example:layout/fragment_carousel: Binary XML file line #11 in com.example:layout/fragment_carousel: Error inflating class org.imaginativeworld.whynotimagecarousel.ImageCarousel
Caused by: android.view.InflateException: Binary XML file line #11 in com.example:layout/fragment_carousel: Error inflating class org.imaginativeworld.whynotimagecarousel.ImageCarousel
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Constructor.newInstance0(Native Method)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
	at android.view.LayoutInflater.createView(LayoutInflater.java:858)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
	at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
	at com.example.databinding.FragmentCarouselBinding.inflate(FragmentCarouselBinding.java:45)
	at com.example.ui.home.carousel.CarouselFragment.onCreateView(CarouselFragment.kt:23)
	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3114)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:557)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839)
	at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1751)
	at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:317)
	at androidx.viewpager2.adapter.FragmentStateAdapter.placeFragmentInViewHolder(FragmentStateAdapter.java:341)
	at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:276)
	at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:67)
	at androidx.recyclerview.widget.RecyclerView.dispatchChildAttached(RecyclerView.java:7867)
	at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:893)
	at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:107)
	at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:8902)
	at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8860)
	at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8848)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1645)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
	at androidx.recyclerview.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1395)
	at androidx.recyclerview.widget.LinearLayoutManager.scrollHorizontallyBy(LinearLayoutManager.java:1124)
	at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:1969)
	at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5476)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
	at android.view.Choreographer.doCallbacks(Choreographer.java:899)
	at android.view.Choreographer.doFrame(Choreographer.java:827)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
@ImaginativeShohag
Copy link
Owner

Please provide a minimal example project to try the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants