We want to measure our (multi module) app performance. I setup macro benchmark but it's not start. When i try to start benckmark, it's throws this message:
Failed to install APK(s): /*****.apk
INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.*** signatures do not match previously installed version; ignoring!
com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.*** signatures do not match previously installed version; ignoring!
Benchmark module build gradle:
buildTypes {
// This benchmark buildType is used for benchmarking, and should function like your
// release build (for example, with minification on). It"s signed with a debug key
// for easy local/CI testing.
create("benchmark") {
isDebuggable = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("debug")
}
}
...
dependencies {
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha09")
}
Benchmark variant on app module's gradle:
create("benchmark") {
val releaseForInitWith = getByName("debug") {
isMinifyEnabled = false
isShrinkResources = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
initWith(releaseForInitWith)
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("debug")
isDebuggable = false
}
Could you help, how can i fix this?
This occurs when the device has a version of the app installed which was signed with a different certificate. That could have been a version installed from the Play Store or a version not signed with the
signingConfig
used for yourbenchmark
build. In this case,signingConfig = signingConfigs.getByName("debug")
.The easiest way to resolve this is by executing
adb uninstall $appPackage
and then running the benchmark again.