我的模块级build.gradle
文件如下所示。
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
defaultConfig {
applicationId "com.appsfreelocker.puppy.pattern.lockscreen"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '21.1.1'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.1.1'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}
项目级build.gradle
文件如下所示:
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
而gradle-wrapper.properties
像这样:
#Mon Apr 09 17:06:49 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
当我尝试构建时,构建失败并出现以下错误:
C:/Users/abc/Desktop/PuppyLockscreen
app/build/intermediates/res/merged/debug/values-v23/values-v23.xml
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
app/build/intermediates/res/merged/debug/values-v24/values-v24.xml
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Gradle Verison 是2.10
,Android 插件版本是2.0.0
我已使用此参考来确保我使用的是 Gradle 版本、Android 插件版本、compileSdkVersion 和 buildToolsVersion 的正确组合。
任何人都可以指出导致错误的原因以及如何修复它。
这个图书馆
compile 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
有依赖关系
compile 'com.android.support:appcompat-v7:25.3.1'.
然后你必须使用:
compileSdkVersion 25
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句