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

TypeError: bundleId.replace is not a function #4533

Open
2 tasks done
harshad3di opened this issue Jul 26, 2024 · 0 comments
Open
2 tasks done

TypeError: bundleId.replace is not a function #4533

harshad3di opened this issue Jul 26, 2024 · 0 comments

Comments

@harshad3di
Copy link

harshad3di commented Jul 26, 2024

What happened?

unable to launch the app on Android Emulator

detox build --configuration android.emu.debug - worked properly

detox test --configuration android.emu.debug ->

  • launched the Emulator
  • Installed the App
  • FAILED to launch the APP in Emulator

What was the expected behaviour?

App Should launch and test the given testCases

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!

ill provide the configuration n test files below

.detoxrc.js

/** @type {Detox.DetoxConfig} /
module.exports = {
testRunner: {
args: {
$0: 'jest',
config: 'e2e/jest.config.js',
},
jest: {
setupTimeout: 120000,
},
},
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/YOUR_APP.app',
build:
'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
},
'ios.release': {
type: 'ios.app',
binaryPath:
'ios/build/Build/Products/Release-iphonesimulator/YOUR_APP.app',
build:
'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build:
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
testBinaryPath:
'android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk',
reversePorts: [8081],
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build:
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
testBinaryPath: 'custom/path/to/app-release-androidTest.apk',
},
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 15',
},
},
attached: {
type: 'android.attached',
device: {
adbName: '.
',
},
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Samsung_active_5_tablet_API_34',
},
},
},
configurations: {
'ios.sim.debug': {
device: 'simulator',
app: 'ios.debug',
},
'ios.sim.release': {
device: 'simulator',
app: 'ios.release',
},
'android.att.debug': {
device: 'attached',
app: 'android.debug',
},
'android.att.release': {
device: 'attached',
app: 'android.release',
},
'android.emu.debug': {
device: 'emulator',
app: 'android.debug',
},
'android.emu.release': {
device: 'emulator',
app: 'android.release',
},
},
};

jest.config.js

/** @type {import('@jest/types').Config.InitialOptions} /
module.exports = {
rootDir: '..',
testMatch: ['/e2e/**/
.test.js'],
testTimeout: 120000,
maxWorkers: 1,
globalSetup: 'detox/runners/jest/globalSetup',
globalTeardown: 'detox/runners/jest/globalTeardown',
reporters: ['detox/runners/jest/reporter'],
testEnvironment: 'detox/runners/jest/testEnvironment',
verbose: true,
};

In what environment did this happen?

Detox version: 20.22.2
React Native version: 0.73.0
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 22.2.0
Device model: Android Emulator name: Samsung_active_5_tablet_API_34
Android version: Android 14.0 arm64-v8a
Test-runner (select one): jest

Detox logs

Detox logs
idc-575@IDC-575s-Mini AwesomeDetox % detox test --configuration android.emu.debug
20:51:07.484 detox[44060] B jest --config e2e/jest.config.js
watchman warning:  Recrawled this watch 13 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/idc-575/Desktop/73Detox/AwesomeDetox' ; watchman watch-project '/Users/idc-575/Desktop/73Detox/AwesomeDetox'`

20:51:17.237 detox[44061] i starter.test.js is assigned to emulator-19454 (Samsung_active_5_tablet_API_34)
20:51:17.239 detox[44061] i Example: should have login button
20:51:17.499 detox[44061] i Example: should have login button [FAIL]

 FAIL  e2e/starter.test.js (9.667 s)
  Example
    ✕ should have login button (258 ms)

  ● Example › should have login button

    TypeError: bundleId.replace is not a function

      at ADB._instrumentationRunnerForBundleId (node_modules/detox/src/devices/common/drivers/android/exec/ADB.js:317:89)
      at ADB.getInstrumentationRunner (node_modules/detox/src/devices/common/drivers/android/exec/ADB.js:308:40)
      at Instrumentation.launch (node_modules/detox/src/devices/common/drivers/android/tools/Instrumentation.js:21:24)
      at MonitoredInstrumentation.launch (node_modules/detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.js:22:5)
      at EmulatorDriver._launchInstrumentationProcess (node_modules/detox/src/devices/runtime/drivers/android/AndroidDriver.js:320:5)
      at EmulatorDriver._launchApp (node_modules/detox/src/devices/runtime/drivers/android/AndroidDriver.js:303:7)
      at EmulatorDriver._handleLaunchApp (node_modules/detox/src/devices/runtime/drivers/android/AndroidDriver.js:124:7)
      at EmulatorDriver.launchApp (node_modules/detox/src/devices/runtime/drivers/android/AndroidDriver.js:97:12)
      at RuntimeDevice.launchApp (node_modules/detox/src/devices/runtime/RuntimeDevice.js:159:35)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        9.724 s
Ran all test suites.
20:51:17.667 detox[44060] E Command failed with exit code = 1:
jest --config e2e/jest.config.js
idc-575@IDC-575s-Mini AwesomeDetox % 

Device logs

Device logs

More data, please!

No response

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

1 participant