We would like to use the test functionality of AppCenter to run our instrumented tests on several test devices. Because our Android app uses dynamic feature modules and AppCenter only accepts APK's, we have to create a bundle, convert it to a fat (universal) APK with the bundletool and sent the fat APK to AppCenter. This works great for distributing our app via AppCenter. However we don't get the testing working.
AppCenter returns this error:
onError: commandError=true message=Permission Denial: starting instrumentation ComponentInfo{a.b.c.tst.test/androidx.test.runner.AndroidJUnitRunner} from pid=15567, uid=15567 not allowed because package a.b.c.tst.test does not have a signature matching the target a.b.c.tst
We tried several things to fix this issue:
- Sign the bundle with the bundletool itself;
- Sign the universal APK with the AndroidSigning task of the Azure pipeline
- Sign the test APK with the same key from the same keystore
- The keystore is located in Azure as a secret and we used it for the steps above. We also tried these steps with a locally stored keystore in the project, and adding this to the build.gradle:
signingConfigs {
debug {
storeFile rootProject.file('debug.keystore')
keyAlias 'debug'
keyPassword 'test!'
storePassword 'test!'
}
}
However, it doesn't work. We are still getting the same error :(.
Does somebody have an idea about what goes wrong? Or has someone get it working for an app with dynamic feature modules and could tell us more about your steps?