com.google.android.material.tabs.TabLayout类错误

com.google.android.material.tabs.TabLayout类错误,第1张

概述我正在尝试实现TabLayout但不幸的是收到此错误,我添加了我的xml代码,任何人都可以帮助弄清楚我做错了什么.以下是我得到的错误日志java.lang.RuntimeException:UnabletostartactivityComponentInfo{com.example.vvdntech.design_material/com.example.vvdntech.design_ma

我正在尝试实现Tab Layout但不幸的是收到此错误,

我添加了我的xml代码,任何人都可以帮助弄清楚我做错了什么.

以下是我得到的错误日志

@H_502_9@java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.vvdntech.design_material/com.example.vvdntech.design_material.LoggedIn}: androID.vIEw.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class com.Google.androID.material.tabs.TabLayout    at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2585)    at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2667)    at androID.app.ActivityThread.-wrap11(ActivityThread.java)    at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)    at androID.os.Handler.dispatchMessage(Handler.java:111)    at androID.os.Looper.loop(Looper.java:207)    at androID.app.ActivityThread.main(ActivityThread.java:5776)    at java.lang.reflect.Method.invoke(Native Method)    at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)    at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:679) Caused by: androID.vIEw.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class com.Google.androID.material.tabs.TabLayout    at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:539)    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:467)    at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)    at com.example.vvdntech.design_material.LoggedIn.onCreate(LoggedIn.java:17)    at androID.app.Activity.performCreate(Activity.java:6582)    at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)    at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2532)    at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2667)     at androID.app.ActivityThread.-wrap11(ActivityThread.java)     at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)     at androID.os.Handler.dispatchMessage(Handler.java:111)     at androID.os.Looper.loop(Looper.java:207)     at androID.app.ActivityThread.main(ActivityThread.java:5776)     at java.lang.reflect.Method.invoke(Native Method)     at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)     at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:679)  Caused by: androID.vIEw.InflateException: Binary XML file line #16: Error inflating class com.Google.androID.material.tabs.TabLayout    at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:776)    at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:704)    at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:835)    at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)    at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:838)    at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)    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:467)     at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)     at com.example.vvdntech.design_material.LoggedIn.onCreate(LoggedIn.java:17)     at androID.app.Activity.performCreate(Activity.java:6582)     at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)     at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:679)  Caused by: java.lang.classNotFoundException: DIDn't find class "com.Google.androID.material.tabs.TabLayout" on path: DexPathList[[zip file "/data/app/com.example.vvdntech.design_material-1/base.apk", zip file "/data/app/com.example.vvdntech.design_material-1/split_lib_dependencIEs_apk.apk", 

这是我的xml文件

@H_502_9@<relativeLayout    xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tools="http://schemas.androID.com/tools"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    tools:context=".LoggedIn">    <androID.support.v4.vIEw.VIEwPager        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:ID="@+ID/pager">        <com.Google.androID.material.tabs.TabLayout            androID:ID="@+ID/tabs"            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content">            <com.Google.androID.material.tabs.TabItem                androID:icon="@drawable/b"                androID:text="tab1" />            <com.Google.androID.material.tabs.TabItem                androID:icon="@drawable/b"                androID:text="tab2"/>            <com.Google.androID.material.tabs.TabItem                androID:icon="@drawable/b"                androID:text="tab3"/>        </com.Google.androID.material.tabs.TabLayout>    </androID.support.v4.vIEw.VIEwPager></relativeLayout>

主要活动我尚未添加任何内容.这完全是练习,所以如果代码中有任何小错误,请告诉.

编辑:我也附上我的gradle文件

@H_502_9@apply plugin: 'com.androID.application'androID {    compileSdkVersion 28    defaultConfig {        applicationID "com.example.vvdntech.design_material"        minSdkVersion 19        targetSdkVersion 28        versionCode 1        versionname "1.0"        testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"    }    buildTypes {        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'        }    }}dependencIEs {    implementation filetree(include: ['*.jar'], dir: 'libs')    implementation 'com.androID.support:appcompat-v7:28.0.0-Alpha3'    implementation 'com.androID.support.constraint:constraint-layout:1.1.2'    testImplementation 'junit:junit:4.12'    androIDTestImplementation 'com.androID.support.test:runner:1.0.2'    androIDTestImplementation 'com.androID.support.test.espresso:espresso-core:3.0.2'    implementation 'com.androID.support:design:28.0.0-Alpha3'}

&安培; https://material.io/develop/android/components/tab-layout/我正在使用此链接,其中选项卡位于视图寻呼机内.

thnx提前

解决方法:

错误的来源是com.Google.androID.material.tabs.TabLayout不是来自支持库,而是来自材料设计库,正如@Doflaminhgo指出的那样.

@H_502_9@dependencIEs {    // ...    implementation 'com.Google.androID.material:material:1.0.0-beta01'    // ...}

参考https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md

我不确定为什么AndroID reference documentation描述了使用Material Components而没有明确提到在该部分的任何地方找到它的位置.

总结

以上是内存溢出为你收集整理的com.google.android.material.tabs.TabLayout类错误全部内容,希望文章能够帮你解决com.google.android.material.tabs.TabLayout类错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1108975.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存