You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to be able to run our Detox e2e tests locally, but as a release build (or as close as we can get). The problem i am struggling with is using a flavor to set this up, in order to avoid signing with a real signing certificate. On CI, the certificate will be available, but for security, we don't keep that locally.
As an example, our flavor setup in build.gradle might look something like this;
signingConfigs {
release {
keyAlias '..'
keyPassword ...
storeFile ..
storePassword ...
}
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
...
buildTypes {
release {
// no signing specified on the build type...
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
...
productFlavors {
// dev {
// }
prod {
// signing for prod specified as release
signingConfig signingConfigs.release
}
e2e {
// signing for e2e flavor specified as debug
signingConfig signingConfigs.debug
}
...
}
Finally, the detox config could look like;
"android.release": {
"type": "android.apk",
// the output will be slightly different, but not relevant to question
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleE2eRelease assembleAndroidTest -DtestBuildType=release && cd .."
}
Unfortunately, this approach does not work. It seems to be ignoring the signing setup for the flavor, possibly specifically around the assembleAndroidTest, but i'm not sure. The following error presents;
> Task :app:packageProdReleaseAndroidTest FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
A problem was found with the configuration of task ':app:packageProdReleaseAndroidTest' (type 'PackageApplication').
- In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.tasks.PackageApplication' property 'signingConfigData.signingConfigData.storeFile' specifies file '/Users/aborton/Code/Account.NativeApp/android/secure/**.jks' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.
Possible solutions:
1. Make sure the file exists before the task is called.
2. Make sure that the task which produces the file is declared as an input.
It's correct, the .jks file it's looking for is not present, but as far as i am concerned, it shouldn't be looking for it.
There is likely a clue here; packageProdReleaseAndroidTest but i can't see why it would try to construct that? prod being a flavor and release being the buildType.
@alexborton Apologies, but I'm not sure how to help here. Might be a good idea to put this out there on Stackoverflow / Discord, instead.
One thing that it might make sense to do is to look for a more specific alternative to running the fully blown assembleAndroidTest gradle task. Likely, you should have something such as assembleE2EAndroidTest available.
This issue appears to be a general usage or support question.
In order to get help, please either ask a question on Stack Overflow with the detox tag, or simply join our Discord. Feel free to post your Stack Overflow question here for more visibility!
For more information about our policy on issues, refer to this discussion.
Description
We want to be able to run our Detox e2e tests locally, but as a release build (or as close as we can get). The problem i am struggling with is using a flavor to set this up, in order to avoid signing with a real signing certificate. On CI, the certificate will be available, but for security, we don't keep that locally.
As an example, our flavor setup in build.gradle might look something like this;
Finally, the detox config could look like;
Unfortunately, this approach does not work. It seems to be ignoring the signing setup for the flavor, possibly specifically around the
assembleAndroidTest
, but i'm not sure. The following error presents;It's correct, the
.jks
file it's looking for is not present, but as far as i am concerned, it shouldn't be looking for it.There is likely a clue here;
packageProdReleaseAndroidTest
but i can't see why it would try to construct that?prod
being a flavor andrelease
being the buildType.Your environment
Detox version: 20.1.1
React Native version: 0.70.6
Node version:
Device model:
OS:
Test-runner (select one): jest
The text was updated successfully, but these errors were encountered: