DetoxRuntimeError:在设备NULL上没有找到包装的仪表赛跑者

发布于 2025-01-31 11:25:34 字数 4351 浏览 4 评论 0原文

我一直在尝试理解此错误,但无法指出没有仪器跑步者背后的原因。我运行命令的那一刻,它会失败。我也无法使用 - 路线跟踪以获取日志。

我能够成功构建项目,生成APK并将其安装在物理设备上,但我无法执行任何测试。

命令我用来运行:纱线排毒:e2e:android-release

我得到以下错误:

1) Scenario: I can locate elements by text # e2e/features/element_location/matchers.feature:6
   ✖ Before # e2e/features/step_definitions/Hooks.js:1
       DetoxRuntimeError: No instrumentation runner found on device null for package com.nanosonics.audit_pro
           at _callee2$ (/Users/asb/Downloads/AuditPro/e2e/features/step_definitions/Hooks.js:13:16)
           at tryCatch (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
           at Generator.invoke [as _invoke] (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:293:22)
           at Generator.next (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:118:21)
           at tryCatch (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
           at invoke (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:154:20)
           at /Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:189:11
           at new Promise (<anonymous>)
           at callInvokeWithMethodAndArg (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:188:16)
           at AsyncIterator.enqueue (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:211:13)
           at AsyncIterator.next (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:118:21)
           at Object.exports.async (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:238:14)
           at World._callee2 (/Users/asb/Downloads/AuditPro/e2e/features/step_definitions/Hooks.js:11:8)
   - Given I tap on the Log a procedure button by text # e2e/features/step_definitions/MatchersSteps.js:1
   - When I tap on the Low Level Disinfected button by text # e2e/features/step_definitions/MatchersSteps.js:1

detoxrc.js

module.exports ={


    "configurations": {

        "android.att.release": {
            "binaryPath": "android/app/build/outputs/apk/qa/app-qa.apk",
            "testBinaryPath": "android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk",
            "build": "cd android && ./gradlew clean && ./gradlew app:assembleQa && ./gradlew assembleAndroidTest -DtestBuildType=release && cd ..", 
            "type": "android.attached",
            "device": {
                "adbName": "21169B056B"
            }
        }
    }
 }  

android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
        ext.kotlinVersion = '1.6.0'
    }
subprojects { 
    ext {
        compileSdk = rootProject.ext.compileSdkVersion
        minSdk = rootProject.ext.minSdkVersion
        targetSdk = rootProject.ext.targetSdkVersion
    }
    afterEvaluate { subproject ->
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
                defaultConfig {
                    minSdkVersion rootProject.ext.minSdkVersion
                    targetSdkVersion rootProject.ext.targetSdkVersion
                }
            }
        }
    }
}

在将排毒纳入该项目之前,我试图集成另一个项目 - 学习。

当我运行db shell pm list instrumentation时,我看到它仍指向另一个项目的包装。

instrumentation:com.pqaa_detox.test/androidx.test.runner.AndroidJUnitRunner (target=com.pqaa_detox)

如何将其更改为我的包裹?

排毒版本:19.6.9 反应本机版本:0.64.2 节点版本:V18.0 设备型号: - Android版本:8.1 测试跑者(选择一个):黄瓜

I have been trying to understand this error but cannot pinpoint the reason behind No instrumentation runner. The moment I run the command, it fails. I am also unable to use --loglevel trace to get the logs.

I am able to build the project successfully, generate apks and install them on my physical device but I am unable to execute any tests.

Command I use to run: yarn detox:e2e:android-release

I get the following error:

1) Scenario: I can locate elements by text # e2e/features/element_location/matchers.feature:6
   ✖ Before # e2e/features/step_definitions/Hooks.js:1
       DetoxRuntimeError: No instrumentation runner found on device null for package com.nanosonics.audit_pro
           at _callee2$ (/Users/asb/Downloads/AuditPro/e2e/features/step_definitions/Hooks.js:13:16)
           at tryCatch (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
           at Generator.invoke [as _invoke] (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:293:22)
           at Generator.next (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:118:21)
           at tryCatch (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
           at invoke (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:154:20)
           at /Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:189:11
           at new Promise (<anonymous>)
           at callInvokeWithMethodAndArg (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:188:16)
           at AsyncIterator.enqueue (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:211:13)
           at AsyncIterator.next (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:118:21)
           at Object.exports.async (/Users/asb/Downloads/AuditPro/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:238:14)
           at World._callee2 (/Users/asb/Downloads/AuditPro/e2e/features/step_definitions/Hooks.js:11:8)
   - Given I tap on the Log a procedure button by text # e2e/features/step_definitions/MatchersSteps.js:1
   - When I tap on the Low Level Disinfected button by text # e2e/features/step_definitions/MatchersSteps.js:1

detoxrc.js

module.exports ={


    "configurations": {

        "android.att.release": {
            "binaryPath": "android/app/build/outputs/apk/qa/app-qa.apk",
            "testBinaryPath": "android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk",
            "build": "cd android && ./gradlew clean && ./gradlew app:assembleQa && ./gradlew assembleAndroidTest -DtestBuildType=release && cd ..", 
            "type": "android.attached",
            "device": {
                "adbName": "21169B056B"
            }
        }
    }
 }  

android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
        ext.kotlinVersion = '1.6.0'
    }
subprojects { 
    ext {
        compileSdk = rootProject.ext.compileSdkVersion
        minSdk = rootProject.ext.minSdkVersion
        targetSdk = rootProject.ext.targetSdkVersion
    }
    afterEvaluate { subproject ->
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
                defaultConfig {
                    minSdkVersion rootProject.ext.minSdkVersion
                    targetSdkVersion rootProject.ext.targetSdkVersion
                }
            }
        }
    }
}

Before I integrated Detox to this project, I was trying to integrate on another project - to learn.

When I run adb shell pm list instrumentation, I see that it is still pointing to package of another project.

instrumentation:com.pqaa_detox.test/androidx.test.runner.AndroidJUnitRunner (target=com.pqaa_detox)

How do I change this to point to my package?

Detox version: 19.6.9
React Native version: 0.64.2
Node version: v18.0
Device model: -
Android version: 8.1
Test-runner (select one): Cucumber

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文