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

Hi am still getting a crash on adding bracket view to the fragment, i have just added in the layout and the app crashes as soon as the fragment is called.I have added the log for reference and i am using the updated version. Thanks in advance, #9

Open
ateeqrehman33 opened this issue Feb 22, 2023 · 3 comments

Comments

@ateeqrehman33
Copy link

                                                                                                Process: com.halil.ozel.unsplashexample, PID: 18477
                                                                                                android.view.InflateException: Binary XML file line #19 in com.halil.ozel.unsplashexample:layout/fragment_brackets: Binary XML file line #19 in com.halil.ozel.unsplashexample:layout/fragment_brackets: Error inflating class com.ventura.bracketslib.BracketsView
                                                                                                Caused by: android.view.InflateException: Binary XML file line #19 in com.halil.ozel.unsplashexample:layout/fragment_brackets: Error inflating class com.ventura.bracketslib.BracketsView
                                                                                                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.halil.ozel.unsplashexample.databinding.FragmentBracketsBinding.inflate(FragmentBracketsBinding.java:45)
                                                                                                	at com.halil.ozel.unsplashexample.databinding.FragmentBracketsBinding.inflate(FragmentBracketsBinding.java:39)
                                                                                                	at com.halil.ozel.unsplashexample.ui.fragment.brackets.BracketsFragment.onCreateView(BracketsFragment.kt:32)
                                                                                                	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104)
                                                                                                	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524)
                                                                                                	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
                                                                                                	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
                                                                                                	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
                                                                                                	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
                                                                                                	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
                                                                                                	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                	at android.os.Looper.loopOnce(Looper.java:226)
                                                                                                	at android.os.Looper.loop(Looper.java:313)
                                                                                                	at android.app.ActivityThread.main(ActivityThread.java:8663)
                                                                                                	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
                                                                                                	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
                                                                                                Caused by: java.lang.ClassCastException: dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper cannot be cast to androidx.fragment.app.FragmentActivity
                                                                                                	at com.ventura.bracketslib.BracketsView.<init>(BracketsView.java:45)
                                                                                                	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.halil.ozel.unsplashexample.databinding.FragmentBracketsBinding.inflate(FragmentBracketsBinding.java:45) 
                                                                                                	at com.halil.ozel.unsplashexample.databinding.FragmentBracketsBinding.inflate(FragmentBracketsBinding.java:39) 
                                                                                                	at com.halil.ozel.unsplashexample.ui.fragment.brackets.BracketsFragment.onCreateView(BracketsFragment.kt:32) 
                                                                                                	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104) 
                                                                                                	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524) 
                                                                                                	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261) 
                                                                                                	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899) 
                                                                                                	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817) 
                                                                                                	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760) 
                                                                                                	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547) 
                                                                                                	at android.os.Handler.handleCallback(Handler.java:938) 
                                                                                                	at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                	at android.os.Looper.loopOnce(Looper.java:226) 
                                                                                                	at android.os.Looper.loop(Looper.java:313) 
                                                                                                	at android.app.ActivityThread.main(ActivityThread.java:8663) 
                                                                                                	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) 
                                                                                                	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) 
@ateeqrehman33 ateeqrehman33 changed the title Hi am still getting a crash on adding bracket view to the fragment, i have just added in the layout and the app crashes as soon as the fragment is called. Thanks in advance, Hi am still getting a crash on adding bracket view to the fragment, i have just added in the layout and the app crashes as soon as the fragment is called.I have added the log for reference and i am using the updated version. Thanks in advance, Feb 22, 2023
@Alexreid2070
Copy link

Hi. I'm having exactly the same issue (ie a crash on layout inflate), using v 1.0.4. Did this get resolved? Thanks.

@MiguelDAD
Copy link

Hi. I'm having exactly the same issue (ie a crash on layout inflate), using v 1.0.4. Did this get resolved? Thanks.

Hello,

I was wondering if you were able to resolve the error that I mentioned in my previous message. Have you found a solution to the problem with your library?

@angelesex
Copy link

Have some problem :( thanks for help

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

4 participants