【问题标题】:Missing classes issue on a xml file?xml文件缺少类问题?
【发布时间】:2018-01-08 16:26:32
【问题描述】:

找不到以下类: - android.support.design.internal.NavigationView(修复构建路径、编辑 XML、创建类) 提示:尝试构建项目。提示:尝试刷新布局。

【问题讨论】:

  • 正如您回答的那样,尝试 cleanrebuild 项目。
  • 是的,我试过了,但这个问题也一样。不能解决
  • 您是否将设计支持库定义为依赖项?向我们展示 build.gradle 文件。
  • 依赖项 { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android .support:design:26.1.0' 实现 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1 ' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }

标签: android


【解决方案1】:
android.support.design.internal.NavigationView

包名本身说明它在internal包内,你不应该直接使用它。

也许您的 XML 中需要这样的东西

<android.support.design.widget.NavigationView
         android:id="@+id/navigation"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_gravity="start"
         app:menu="@menu/my_navigation_items" />

【讨论】:

    猜你喜欢
    • 2011-11-24
    • 1970-01-01
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-02
    • 2012-11-30
    • 2013-09-02
    相关资源
    最近更新 更多