Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure for Android release binary #3281

Closed
2 tasks done
dannyMattr opened this issue Mar 28, 2022 · 1 comment
Closed
2 tasks done

Build failure for Android release binary #3281

dannyMattr opened this issue Mar 28, 2022 · 1 comment

Comments

@dannyMattr
Copy link

What happened?

When running the detox build command for the below detox configuration,
"android.release": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk", "build": "cd android ; ./gradlew assembleReleaseE2E assembleAndroidTest -DtestBuildType=releaseE2E && cd .." }
build fails with the following message:
`> Task :app:processReleaseE2EAndroidTestResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processReleaseE2EAndroidTestResources'.

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:: AAPT: error: resource style/Widget.AppCompat.TextView (aka global.mattr.mobile.verifier.test:style/Widget.AppCompat.TextView) not found.
error: resource style/Widget.AppCompat.TextView (aka global.mattr.mobile.verifier.test:style/Widget.AppCompat.TextView) not found.
error: failed linking references.`

I've managed to get over this issue by changing the build.gradle file from androidTestImplementation('com.wix:detox:+') to implementation('com.wix:detox:+'), but when attempting to run the binary built, it throws the following error:
detox[4773] ERROR: [EXEC_FAIL, #49] ""/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"global\.mattr\.mobile\.verifier$\""" failed with error = ChildProcessError: Command failed: "/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"global\.mattr\.mobile\.verifier$\""
The app is successfully installed on the emulator and can be opened manually fine afterwards. Also, running the failed command after opening the app once runs fine. It seems to be failing to launch the app for some reason.

Exactly the same project runs successfully for debug build and run with the following config:
"android.debug": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android ; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug ; cd -" },

Detox logs attached
detoxLogs.txt

What was the expected behaviour?

builds and runs detox tests successfully for release variant as with debug variant

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

  1. configure the android release build
  2. run the build script (initial failure without my fix)
  3. run the test script (execution failure as attached)

In what environment did this happen?

Detox version: 19.5.7
React Native version: 0.67.4
Node version: 16.14.2
Device model: Macbook Pro (2019) macOS: Monterey
Android version: 11 (emulator)
Test-runner (select one): jest-circus

Detox logs

see attached

Device logs

Device logs
10:25:15.824 detox[37716] INFO:  [test.js] DETOX_CONFIGURATION="android" DETOX_RECORD_LOGS="all" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1648502715804 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' e2e
10:25:23.224 detox[37717] INFO:  Example is assigned to emulator-19690 (Pixel_2_API_30)
10:25:25.184 detox[37717] ERROR: [EXEC_FAIL, #28] ""/Users/danny.jung/Library/Android/sdk/platform-tools/adb" -s emulator-19690 shell "ps | grep \"global\.mattr\.mobile\.verifier$\""" failed with error = ChildProcessError: Command failed: "/Users/danny.jung/Library/Android/sdk/platform-tools/adb" -s emulator-19690 shell "ps | grep \"global\.mattr\.mobile\.verifier$\""
 `"/Users/danny.jung/Library/Android/sdk/platform-tools/adb" -s emulator-19690 shell "ps | grep \"global\.mattr\.mobile\.verifier$\""` (exited with error code 1) (code=1), stdout and stderr:

10:25:25.185 detox[37717] ERROR: [EXEC_FAIL, #28] 
10:25:25.185 detox[37717] ERROR: [EXEC_FAIL, #28] 

More data, please!

No response

@github-actions
Copy link

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Feel free to post your Stack Overflow question here for more visibility! We'll take a look at it.

Refer to this discussion for more information about our policy on issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants