2016-07-26 67 views
0

我正试图在我的应用中实现底部栏。我尝试了好几种库,例如当api级别小于23时,无法集成android底部栏

但问题是,当遵守SDK版本低于23,我不能集成任何的库。如果我试图整合它,它说

/home/user/droid-work/TestBBar/app/build/intermediates/res/merged/debug/values-v23/values-v23.xml

Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(34) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/root/Android/Sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

这里是我的build.gradle文件

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 

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

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:22.2.1' 
    compile 'com.android.support:design:22.2.1' 

    compile 'com.aurelhubert:ahbottomnavigation:1.3.3' 

    //or compile 'com.roughike:bottom-bar:1.4.0.1' 

    //or compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:1.0.7' 

} 
+0

您的编译SDK版本必须与支持库的主要版本匹配。由于您使用的是支持库的版本23,因此需要根据Android SDK的版本23进行编译。 或者,您可以通过切换到最新的支持库v22继续针对Android SDK的版本22进行编译。 Courtsy:[这里](http://stackoverflow.com/questions/32075498/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name) – LvN

回答

0

正确的。如果编译少于23,那么它不知道v-23是什么。没有理由为什么不能用23甚至24编译,这是targetSDKVersion有差别,你可以在22
离开也行,请确保您的MaterialCompat库添加到您的应用程序。

相关问题