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

with hilt, throws RuntimeException: Unable to start activity ComponentInfo{} #160

Open
fitareq opened this issue Nov 13, 2022 · 1 comment

Comments

@fitareq
Copy link

fitareq commented Nov 13, 2022

java.lang.RuntimeException: Unable to start activity ComponentInfo{}
Error inflating class com.chinalwb.are.AREditor

@fitareq
Copy link
Author

fitareq commented Nov 13, 2022

Here is the full error log:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.group.dird.dms, PID: 12768
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.group.dird.dms/com.group.dird.dms.ui.file_approval.FileApprovalActivity}: android.view.InflateException: Binary XML file line #12 in com.group.dird.dms:layout/activity_file_approval: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Error inflating class com.chinalwb.are.AREditor
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3271)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: android.view.InflateException: Binary XML file line #12 in com.group.dird.dms:layout/activity_file_approval: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Error inflating class com.chinalwb.are.AREditor
Caused by: android.view.InflateException: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Error inflating class com.chinalwb.are.AREditor
Caused by: android.view.InflateException: Binary XML file line #220 in com.group.dird.dms:layout/fragment_file_approval: Error inflating class com.chinalwb.are.AREditor
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at com.group.dird.dms.databinding.FragmentFileApprovalBinding.inflate(FragmentFileApprovalBinding.java:144)
at com.group.dird.dms.ui.file_approval.FileApprovalFragment.onCreateView(FileApprovalFragment.kt:48)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3065)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2988)
E/AndroidRuntime: at androidx.fragment.app.FragmentStateManager.ensureInflatedView(FragmentStateManager.java:392)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:281)
at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:140)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:319)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:298)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1069)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at com.group.dird.dms.databinding.ActivityFileApprovalBinding.inflate(ActivityFileApprovalBinding.java:43)
at com.group.dird.dms.databinding.ActivityFileApprovalBinding.inflate(ActivityFileApprovalBinding.java:37)
at com.group.dird.dms.ui.file_approval.FileApprovalActivity.onCreate(FileApprovalActivity.kt:18)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3246)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: java.lang.ClassCastException: dagger.hilt.android.internal.managers.ViewComponentManager$FragmentContextWrapper cannot be cast to android.app.Activity
at com.chinalwb.are.styles.toolbar.ARE_Toolbar.(ARE_Toolbar.java:357)
at com.chinalwb.are.styles.toolbar.ARE_Toolbar.(ARE_Toolbar.java:352)
at com.chinalwb.are.styles.toolbar.ARE_Toolbar.(ARE_Toolbar.java:348)
at com.chinalwb.are.AREditor.initGlobal(AREditor.java:156)
at com.chinalwb.are.AREditor.init(AREditor.java:148)
at com.chinalwb.are.AREditor.(AREditor.java:135)
at com.chinalwb.are.AREditor.(AREditor.java:122)
... 54 more

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

No branches or pull requests

2 participants