首页 > 解决方案 > 错误:无法获取 ProductFlavor_Decorated 的未知属性“FabricApiKey”

问题描述

错误:

Could not get unknown property 'FabricApiKey' for
ProductFlavor_Decorated{name=play, dimension=store,
minSdkVersion=null, targetSdkVersion=null, renderscriptTargetApi=null,
renderscriptSupportModeEnabled=null,
renderscriptSupportModeBlasEnabled=null,
renderscriptNdkModeEnabled=null, versionCode=null, versionName=null,
applicationId=null, testApplicationId=null,
testInstrumentationRunner=null, testInstrumentationRunnerArguments={},
testHandleProfiling=null, testFunctionalTest=null, signingConfig=null,
resConfig=null, mBuildConfigFields={}, mResValues={},
mProguardFiles=[], mConsumerProguardFiles=[],
mManifestPlaceholders={}, mWearAppUnbundled=null} of type
com.android.build.gradle.internal.dsl.ProductFlavor.

我的代码是

flavorDimensions "store"
productFlavors {
    fdroid {
        dimension "store"
    }
    play {
        dimension "store"
        resValue 'string', 'io.fabric.ApiKey', FabricApiKey         //error here
        resValue "bool", "com.crashlytics.RequireBuildId", "false"
    }
}

打开之前创建的项目时,我无法在 Android Studio 应用上同步失败。因为同步失败时,无法显示xml列表等。如何克服这些问题

标签: javaandroidandroid-studiogradlebuild.gradle

解决方案


推荐阅读