排毒指向错误的SDK /仿真器位置

问题描述

基本上所有配置都OK,排毒构建成功。 当我尝试运行排毒时,以某种方式[exec.js / EXEC_CMD,#0]“ / usr / local / bin / emulator”指向模拟器的错误位置。在bash_profile中,所有设置都正常(回显,其他命令正在运行)。

在另一台笔记本电脑上,它可以正常工作: detox [26099]调试:[exec.js / EXEC_CMD,#0]“ / Users / admin / Library / Android / sdk / emulator / emulator” -list-avds --verbose

有任何提示吗?

“排毒”:“ ^ 17.6.0”, “ react-native”:“〜0.62.2”,

EN610483:da-paperround sebastianRad$ 
EN610483:da-paperround sebastianRad$ detox test --configuration android.emu.debug2 --loglevel trace
detox[8613] INFO:  [test.js] configuration="android.emu.debug2" loglevel="trace" useCustomLogger=true forceAdbInstall=false DETOX_START_TIMESTAMP=1601579145011 readOnlyEmu=false reportSpecs=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
detox[8615] TRACE: [Detox.js/DETOX_CREATE] created a Detox instance with config:
{"artifactsConfig":{"rootDir":"artifacts/android.emu.debug2.2020-10-01 19-05-45Z","plugins":{"log":{"enabled":false,"keepOnlyFailedTestsArtifacts":false},"screenshot":{"enabled":true,"shouldTakeAutomaticSnapshots":false,"video":{"enabled":false,"instruments":{"enabled":false,"timeline":{"enabled":false}},"pathBuilder":{"_rootDir":"artifacts/android.emu.debug2.2020-10-01 19-05-45Z"}},"behaviorConfig":{"init":{"reinstallApp":true,"exposeGlobals":true,"launchApp":true},"cleanup":{"shutdownDevice":false}},"cliConfig":{"configuration":"android.emu.debug2","forceAdbInstall":"false","loglevel":"trace","useCustomLogger":"true"},"deviceConfig":{"binaryPath":"android/app/build/outputs/apk/debug/app-debug.apk","build":"cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..","type":"android.emulator","device":{"avdName":"Pixel_API_28_AOSP2"}},"runnerConfig":{"testRunner":"jest","runnerConfig":"e2e/config.json","specs":"e2e"},"sessionConfig":{"autoStart":true,"server":"ws://localhost:50372","sessionId":"03b67aba-fa64-bb02-961c-60c5335e4baf"},"errorBuilder":{"filepath":"/Users/sebastianRad/project/da-paperround/.detoxrc.json","contents":{"testRunner":"jest","configurations":{"ios.sim.debug":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/paperrround.app","build":"xcodebuild -workspace ios/paperrround.xcworkspace -scheme paperrround -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 11' -derivedDataPath ios/build","type":"ios.simulator","name":"iPhone 11","os":"13.0"},"ios.sim.debug2":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/paperrround.app",name=iPhone 11 Pro' -derivedDataPath ios/build","name":"iPhone 11 Pro","ios.sim.debug3":{"binaryPath":"ios/build/Build/Products/Debug-iphonesimulator/paperrround.app",name=iPhone SE' -derivedDataPath ios/build","name":"iPhone SE"},"android.emu.debug":{"binaryPath":"android/app/build/outputs/apk/debug/app-debug.apk","android.emu.debug2":{"binaryPath":"android/app/build/outputs/apk/debug/app-debug.apk","device":{"avdName":"Pixel_API_28_AOSP2"}}}},"configurationName":"android.emu.debug2"}}
detox[8615] INFO:  [DetoxServer.js] server listening on localhost:50372...
detox[8615] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:50372
detox[8615] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"03b67aba-fa64-bb02-961c-60c5335e4baf","role":"tester"},"messageId":0}
detox[8615] DEBUG: [DetoxServer.js/LOGIN] role=tester,sessionId=03b67aba-fa64-bb02-961c-60c5335e4baf
detox[8615] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester,sessionId=03b67aba-fa64-bb02-961c-60c5335e4baf
detox[8615] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","messageId":0}
 
detox[8615] DEBUG: [exec.js/EXEC_CMD,#0] "/usr/local/bin/emulator" -list-avds --verbose
detox[8615] TRACE: [exec.js/EXEC_SUCCESS,#0] Pixel_API_28_AOSP2

 

detox[8615] DEBUG: [exec.js/EXEC_CMD,#1] "/usr/local/bin/emulator" -version

detox[9204] DEBUG: [exec.js/EXEC_CMD,#1] "/usr/local/bin/emulator" -version
detox[9204] ERROR: [exec.js/EXEC_FAIL,#1] ""/usr/local/bin/emulator" -version" failed with code = 2,stdout and stderr:

 

detox[9204] ERROR: [exec.js/EXEC_FAIL,#1] 
detox[9204] ERROR: [exec.js/EXEC_FAIL,#1] [4607778240]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at /usr/local/emulator/lib64/qt/lib
Could not launch '/usr/local/emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory

 

detox[9204] ERROR: [EmulatorVersionResolver.js/EMU_BIN_VERSION_DETECT] Could not detect emulator binary version ChildProcessError: Command failed: "/usr/local/bin/emulator" -version
[4607778240]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at /usr/local/emulator/lib64/qt/lib
Could not launch '/usr/local/emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory
 `"/usr/local/bin/emulator" -version` (exited with error code 2)
    at callback (/Users/sebastianRad/project/da-paperround/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (child_process.js:315:5)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  code: 2,childProcess: {
    _forkChild: [Function: _forkChild],ChildProcess: [Function: ChildProcess],exec: [Function: exec],execFile: [Function: execFile],execFileSync: [Function: execFileSync],execSync: [Function: execSync],fork: [Function: fork],spawn: [Function: spawn],spawnSync: [Function: spawnSync]
  },stdout: '',stderr: '[4607778240]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at /usr/local/emulator/lib64/qt/lib\n' +
    "Could not launch '/usr/local/emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory\n"
}
detox[9204] WARN:  [AVDValidator.js/AVD_VALIDATION] Emulator version detection failed (See previous logs)
detox[9204] DEBUG: [exec.js/EXEC_CMD,#2] "/usr/local/bin/emulator" -version

解决方法

在手动发送了仿真器的路径并且不使用android_home或android_sdk_root后工作。 这里有一些提示:https://medium.com/@wnyao0830/run-create-react-native-app-on-android-studios-emulator-ad678a0c362f#:~:text=Here%20i%20will%20step%20through,your%20emulator%20to%20run%20with

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...