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

Issue finding Android APK #4057

Closed
davidmcraejr opened this issue May 15, 2023 · 5 comments
Closed

Issue finding Android APK #4057

davidmcraejr opened this issue May 15, 2023 · 5 comments

Comments

@davidmcraejr
Copy link

Description

I am setting up detox in our React Native application, I have iOS running and now running into issues for Android. In the .detoxrc.js config file I have android/app/build/outputs/apk/androidTest/dev/debug/app-dev-debug-androidTest.apk set as the binaryPath for Android but when I run detox test --configuration android.emu.debug I get the output of The test APK could not be found at path: '/Users/xxx/Documents/git/mobile-app/android/app/build/outputs/apk/androidTest/androidTest/devDebug/androidTest/app-dev-debug-androidTest-androidTest.apk'
Somehow it seems to be appending extra path and file data, thoughts?

Your environment

Detox version: 20.7.2
React Native version: 0.71.3
Node version: 18.9.0
Device model: Emulator
OS: Android
Test-runner (select one): jest

@davidmcraejr
Copy link
Author

didn't realize there was a testBinaryPath and a binaryPath

@KaterinaUK
Copy link

@davidmcraejr I have the exact same issue as you described, what did you place in each of testBinaryPath and binaryPath?

to build our app we use npx react-native run-android, which gives me only the android/app/build/outputs/apk/debug/app-debug.apk

and it seems I cannot put this path as the same location for both values.

@davidmcraejr
Copy link
Author

@KaterinaUK we build a debug app and test app so have two apk's to use for each values, here what we have -

binaryPath: 'android/app/build/outputs/apk/local/debug/app-local-debug.apk',
testBinaryPath: 'android/app/build/outputs/apk/androidTest/local/debug/app-local-debug-androidTest.apk',

@KaterinaUK
Copy link

KaterinaUK commented Aug 14, 2023

@davidmcraejr how are you going about building each of these?

I think I am not following why detox needs two apks, npx react-native run-android, gives me my apk on an emulator and im ready to run tests on it

@davidmcraejr
Copy link
Author

We run

build: 'cd android && ./gradlew assembleDevDebug assembleAndroidTest -DtestBuildType=debug && cd ..',

NOTE: "assembleDevDebug" is a specific build type for us so you would have to set the build types that are associated with your project.

Once those are setup correctly and pointed correctly - Detox will install the correct app and run the tests

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