assembleReleaseStaging

assembleReleaseStaging

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分钟前评论),因为我有一个(肮脏的)解决方案。您可能有releasereleaseStaging对吗? assembleRelease通过时,assembleReleaseStaging将失败。我添加了一个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失败?

08-17 22:13