Skip to content

Commit b9eb8a8

Browse files
abueideclaude
andcommitted
fix(rn): ensure Android SDK is set up before gradle builds
React Native test suites also need the SDK setup before calling gradle directly. Added the same SDK initialization check to both Android E2E and All E2E test suites. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent fcc005c commit b9eb8a8

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

examples/react-native/tests/test-suite-all-e2e.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ processes:
2121
command: |
2222
set -e
2323
24+
# Ensure Android SDK is set up (needed when calling gradle directly)
25+
if [ -z "${ANDROID_SDK_ROOT:-}" ] && [ -n "${ANDROID_SCRIPTS_DIR:-}" ]; then
26+
if [ -f "${ANDROID_SCRIPTS_DIR}/init/setup.sh" ]; then
27+
. "${ANDROID_SCRIPTS_DIR}/init/setup.sh"
28+
fi
29+
fi
30+
2431
# Source Metro environment so build knows correct port
2532
. ${REACT_NATIVE_VIRTENV}/metro/env-all.sh
2633
echo "Metro port for build: $METRO_PORT"

examples/react-native/tests/test-suite-android-e2e.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ processes:
2020
command: |
2121
set -e
2222
23+
# Ensure Android SDK is set up (needed when calling gradle directly)
24+
if [ -z "${ANDROID_SDK_ROOT:-}" ] && [ -n "${ANDROID_SCRIPTS_DIR:-}" ]; then
25+
if [ -f "${ANDROID_SCRIPTS_DIR}/init/setup.sh" ]; then
26+
. "${ANDROID_SCRIPTS_DIR}/init/setup.sh"
27+
fi
28+
fi
29+
2330
# Source Metro environment so build knows correct port
2431
. ${REACT_NATIVE_VIRTENV}/metro/env-android.sh
2532
echo "Metro port for build: $METRO_PORT"

0 commit comments

Comments
 (0)