简体   繁体   English

错误:java.lang.ClassCastException LinearLayout$LayoutParams cannot be cast, when starting app

[英]Error: java.lang.ClassCastException LinearLayout$LayoutParams cannot be cast ,when starting app

Hello I am struggling with an error when starting my app here is the error log, I am trying to add a forground service to the app but removing the code for it does not fix the issue, I have tried a fresh install of the app onmy device, clean project, rebuild project, restarting android studio I seriously dont even know where to begin to solve this error您好,我在启动我的应用程序时遇到错误,这里是错误日志,我正在尝试向该应用程序添加一个前台服务,但删除它的代码并不能解决问题,我已经尝试在我的应用程序上重新安装该应用程序设备,清理项目,重建项目,重启 android studio 我真的不知道从哪里开始解决这个错误

E/racticesmartap: [qarth_debug:]  get PatchStore::createDisableExceptionQarthFile method fail.
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.smartpractice.smartpracticesmartapp, PID: 10481
    java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams
        at androidx.constraintlayout.widget.ConstraintLayout.getTargetWidget(ConstraintLayout.java:1144)
        at androidx.constraintlayout.widget.ConstraintLayout.setChildrenConstraints(ConstraintLayout.java:1021)
        at androidx.constraintlayout.widget.ConstraintLayout.updateHierarchy(ConstraintLayout.java:803)
        at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1561)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6834)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6834)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1565)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:726)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6834)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6834)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1565)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:726)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6834)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:847)
        at android.view.View.measure(View.java:23454)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2954)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1753)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2041)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1636)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7946)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
        at android.view.Choreographer.doCallbacks(Choreographer.java:893)
        at android.view.Choreographer.doFrame(Choreographer.java:812)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1078)
        at android.os.Handler.handleCallback(Handler.java:907)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

I do not know where this error occurs, please help不知道哪里出错了,求助

You are trying to cast LinearLayout to ConstraintLayout.您正在尝试将 LinearLayout 转换为 ConstraintLayout。 But you can import the corresponding layout in LinearLayout.但是可以在LinearLayout中导入对应的布局。

E/racticesmartap: [qarth_debug:] get PatchStore::createDisableExceptionQarthFile method fail. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.smartpractice.smartpracticesmartapp, PID: 10481 java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to androidx.constraintlayout.widget.ConstraintLayout$LayoutParams –

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.ClassCastException:android.widget.RelativeLayout $ LayoutParams无法转换为android.widget.LinearLayout $ LayoutParams - java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams 无法将Java.lang.classcastexception linearlayout.layoutParams强制转换为framelayout.layoutparams - Java.lang.classcastexception linearlayout.layoutParams cannot be cast to framelayout.layoutparams java.lang.ClassCastException:android.widget.LinearLayout $ LayoutParams无法转换为android.widget.AbsListView $ LayoutParams - java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams java.lang.ClassCastException:android.widget.LinearLayout $ LayoutParams无法转换为android.widget.FrameLayout - java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.FrameLayout Android java.lang.ClassCastException:android.widget.LinearLayout $ LayoutParams无法强制转换为android.widget.AbsListView $ LayoutParams - Android java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams 不能转换为 android.support.constraint.ConstraintLayout$LayoutParams - java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.constraint.ConstraintLayout$LayoutParams java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams 不能转换为 android.support.v7.widget.RecyclerView$LayoutParams - java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v7.widget.RecyclerView$LayoutParams ClassCastException:java.lang.ClassCastException:android.widget.LinearLayout $ LayoutParams无法强制转换为android.support.v4.widget.DrawerLayout - ClassCastException : java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout java.lang.ClassCastException:GridLayout.LayoutParams无法强制转换为Frame.LayoutParams - java.lang.ClassCastException: GridLayout.LayoutParams cannot cast to Frame.LayoutParams java.lang.ClassCastException:android.widget.RelativeLayout $ LayoutParams无法转换为android.widget.FrameLayout $ LayoutParams - java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM