添加AppIntro库时出错类android.support.design.widget.NavigationView时出错

时间:2016-01-08 16:14:16

标签: build.gradle

我的应用运行正常。一旦我将“compile”com.github.paolorotolo:appintro:3.3.0'“添加到我的依赖项以包含this库,就会发生以下错误: Error inflating class android.support.design.widget.NavigationView

这是我的完整build.gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.myId"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
    compile 'com.github.paolorotolo:appintro:3.3.0'    #This line makes it crash
}

2 个答案:

答案 0 :(得分:1)

最后我发现我必须改变

compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'

答案 1 :(得分:0)

原因可能是风格。尝试在Manifest中使用

<activity android:name=".IntroActivity" ndroid:theme="@style/FullscreenTheme"/>

并在styles.xml中:

<style name="FullscreenTheme" parent="Theme.AppCompat.Light.NoActionBar"/>