我正试图在我的应用中实现底部栏。我尝试了好几种库,例如当api级别小于23时,无法集成android底部栏
- https://github.com/roughike/BottomBar
- https://github.com/aurelhubert/ahbottomnavigation
- https://github.com/sephiroth74/Material-BottomNavigation
但问题是,当遵守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'
}
您的编译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