5 / 5 / 3
Регистрация: 29.01.2015
Сообщений: 189
1

Error inflating class android.support.design.widget.NavigationView

19.12.2017, 22:37. Показов 6926. Ответов 2
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Замучился бороться с этими библиотеками совместимости.
Поиск и применение возможных решений проблемы в google не увенчались успехом.

При запуске ошибка в logcat:
XML
1
2
3
4
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.alexsprod.jsonparserproject, PID: 10482
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alexsprod.jsonparserproject/com.alexsprod.jsonparserproject.ParserMain}: android.view.InflateException: Binary XML file line #0: Error inflating class android.support.design.widget.NavigationView
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
Есть NavDrawer, созданный по шаблону Android Studio.

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn="navigation_view">
    <group android:checkableBehavior="single">
        <item
            android:id="@+id/cat1"
            android:icon="@drawable/ic_menu_camera"
            android:title="@string/nav_btn1" />
        <item
            android:id="@+id/cat2"
            android:icon="@drawable/ic_menu_gallery"
            android:title="@string/nav_btn2" />
        <item
            android:id="@+id/cat3"
            android:icon="@drawable/ic_menu_slideshow"
            android:title="@string/nav_btn3" />
    </group>
</menu>
Мой gradle:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
android {
    compileSdkVersion 26
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 26
       ...
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
 
   ....
   distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
19.12.2017, 22:37
Ответы с готовыми решениями:

Ошибка "Error inflating class android.support.design.widget.NavigationView"
При старте приложения получаю такую ошибку: java.lang.RuntimeException: Unable to start...

Error inflating class android.support.design.widget.TabLayout
Всем привет, при сборке проекта выскакивает ошибка, никак не могу понять в чем проблема - прошу...

Eclipse proguard public class android.support.v7.internal.widget.ActionBarView.HomeView
Добрый день. Сейчас изучаю разработку под андроид. Споткнулся на следующей ошибке This class...

Error inflating class VideoView
Здравствуйте, уважаемые форумчане. Продолжаю я познавать кодинг под андроид. Уже познал создание...

2
2883 / 2295 / 769
Регистрация: 12.05.2014
Сообщений: 7,978
20.12.2017, 12:04 2
где разметка с этим NavView?
0
5 / 5 / 3
Регистрация: 29.01.2015
Сообщений: 189
20.12.2017, 12:30  [ТС] 3
Здесь. И может есть какие-нибудь рекомендации по ним?
1:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.alexsprod.jsonparserproject.ParserMain"
    tools:showIn="@layout/app_bar_parser_main">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="_"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
2:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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="com.alexsprod.jsonparserproject.ParserMain">
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />
    </android.support.design.widget.AppBarLayout>
    <include layout="@layout/content_parser_main" />
</android.support.design.widget.CoordinatorLayout>
3:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">
    <include
        layout="@layout/app_bar_parser_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_parser_main"
        app:menu="@menu/activity_parser_main_drawer" />
</android.support.v4.widget.DrawerLayout>
4:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn="navigation_view">
    <group android:checkableBehavior="single">
        <item
            android:id="@+id/cat1"
            android:icon="@drawable/ic_menu_camera"
            android:title="@string/nav_btn1" />
        <item
            android:id="@+id/cat2"
            android:icon="@drawable/ic_menu_gallery"
            android:title="@string/nav_btn2" />
        <item
            android:id="@+id/cat3"
            android:icon="@drawable/ic_menu_slideshow"
            android:title="@string/nav_btn3" />
    </group>
</menu>
0
20.12.2017, 12:30
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
20.12.2017, 12:30
Помогаю со студенческими работами здесь

Android.support.v7.widget.GridLayout
Друзья, помогите пожалуйста! Никак не получается включить GridLayout в макет из библиотеки...

Binary XML file line #XXX: Error inflating class
Хочу сделать компонент, для возможности использования его несколько раз... При компиляции получаю...

Как подключить com.android.support:design в Eclipse
Доброго дня! Недавно вышла новая библиотека com.android.support:design - вопрос как её подключить...

Caused by: android.view.InflateException: Binary XML file line #13: Binary XML file line #13: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #13: Binary XML file line #13: Error...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru