在版本

时间:2019-02-08 13:46:51

标签: android detox

我正在使用排毒功能来测试本机应用程序。

使用-DtestBuildType = debug

时,iOS测试正在运行,而android测试也正在运行

现在,我想使-DtestBuildType = release正常工作,因为我想在位升上对其进行测试,并且在此方面无法成功使用调试模式。

我创建了一个模拟器,该模拟器正在Android Studio中进行调试。 用于发布的package.json配置如下:

"android.emu.debug": {
    "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
    "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
    "type": "android.emulator",
    "name": "Nexus_5X_API_26"
  },
  "android.emu.release": {
    "binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
    "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
    "type": "android.emulator",
    "name": "Nexus_5X_API_26"
  }

运行detox test -c android.emu.release --loglevel trace时排毒失败,并显示Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

跟踪显示给我们

detox[16787] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=ff9d0ed4-d98e-c4ff-397c-9b32e357247a)

java.lang.NoSuchMethodError: No virtual method addReactInstanceEventListener(Lcom/facebook/react/ReactInstanceManager$ReactInstanceEventListener;)V in class Lcom/facebook/react/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in /data/app/com.XXXX/base.apk)
    at com.wix.detox.ReactNativeSupport$2.run(Unknown Source:28)
    at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2092)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

构建发行版APK时是否缺少某些东西,从而无法正确连接排毒?

谢谢!

0 个答案:

没有答案