无法获得扩展"安卓"的未知属性"实验属性" |Android Jetpack Macrobenchmark



下面是-https://developer.android.com/studio/profile/macrobenchmark#configuration

在我的宏基准的构建中的以下代码中.gradle

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
targetProjectPath = ":app" // Note that your module name may be different
experimentalProperties["android.experimental.self-instrumenting"] = true
buildTypes {
release {
debuggable = true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

渐变同步时引发以下构建错误:

A problem occurred evaluating project ':macrobenchmark'.
> Could not get unknown property 'experimentalProperties' for extension 'android' of type com.android.build.gradle.TestExtension.

我是安卓系统的新手,任何帮助都将不胜感激,提前感谢。

通过以下-修复了错误

  1. 更新安卓工作室至Arctic Fox测试版
  2. 已将项目build.gradle中的gradle版本更新为7.0 beta4

通过谷歌提供的基准测试样本库的文档和gradle文件的比较找到了解决方案。

由于其他依赖关系,我不得不在项目build.gradle文件中更新到gradle插件的7.1.0-alpha02版本。

这个财产得到了认可。

最新更新