Failed to generate resource table for split ''
/Users/me/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/5350756d4feccc54333994727594933b/res/values-v28/values-v28.xml:5:5-8:13: AAPT: No resource found that matches the given name (at 'dialogCornerRadius' with value '?android:attr/dialogCornerRadius').
我一生都无法弄清楚如何解决这个问题。这仅在我构建应用的发布版本时发生。以下是我目前正在使用的版本。
implementation "com.android.support:appcompat-v7:28.0.0"
compileSdkVersion 28
buildToolsVersion "28.0.0"
好的,我将对此给出答案(我在 15 分钟前发表了评论),因为我有一个(肮脏的)解决方案。你可能有一个release
和releaseStaging
吧? assembleReleaseStaging
通过时,assembleRelease
将失败。我添加了一个assembleReleaseProduction
buildType,如下所示:
buildTypes {
debug {
applicationIdSuffix ".debug"
buildConfigField "String", "CODEPUSH_KEY", """"
}
releaseStaging {
applicationIdSuffix ".staging"
matchingFallbacks = ['release', 'debug']
signingConfig signingConfigs.staging
buildConfigField "String", "CODEPUSH_KEY", ""wont-give-it""
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
releaseProduction {
matchingFallbacks = ['release']
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", ""wont-give-it""
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
release {
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", ""wont-give-it""
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
请注意,releaseProduction
应包含matchingFallbacks = ['release']
。
虽然这工作正常,但它并不让我满意。为什么assembleReleaseStaging
通过,assembleRelease
失败?