简体   繁体   English

我的 Android Studio 项目中的运行时错误是什么?

[英]What is the runtime error in my Android Studio project?

In order to make the words minimal, I have attached the files to the link below, on Google Drive.为了使文字最少,我已将文件附加到以下链接,位于 Google Drive 上。 I will only attach the runtime error in here.我只会在这里附上运行时错误。

Link:关联:

https://drive.google.com/drive/folders/11GiiPwRUKGJ3dLIRWsYO63JVGxwYymz1 https://drive.google.com/drive/folders/11GiiPwRUKGJ3dLIRWsYO63JVGxwYymz1

Error:错误:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.wecarerestaurant.team, PID: 3155
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wecarerestaurant.team/com.wecare.team.Dashboard}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.widget.CollapsingToolbarLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.widget.CollapsingToolbarLayout
     Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.design.widget.CollapsingToolbarLayout
     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:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.wecare.team.Dashboard.onCreate(Dashboard.java:21)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 2: TypedValue{t=0x2/d=0x7f0400c2 a=-1}
        at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:946)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
E/AndroidRuntime:     at android.support.design.widget.CollapsingToolbarLayout.<init>(CollapsingToolbarLayout.java:228)
        at android.support.design.widget.CollapsingToolbarLayout.<init>(CollapsingToolbarLayout.java:151)
            ... 30 more
I/Process: Sending signal. PID: 3155 SIG: 9
Disconnected from the target VM, address: 'localhost:8676', transport: 'socket'

As your Error log has below line由于您的错误日志具有以下行

android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.widget.CollapsingToolbarLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913) android.view.InflateException:二进制 XML 文件第 17 行:二进制 XML 文件第 17 行:在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913) 处膨胀类 android.support.design.widget.CollapsingToolbarLayout 时出错

Exception - InflateException异常- InflateException

Error in - XML file at line number 17.错误- XML文件的第 17 行。

while inflating CollapsingToolbarLayout膨胀CollapsingToolbarLayout

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM