AndroidTest:构建失败,导致找不到RealmSet $ <field>

问题描述

我正在用Java和Realm Mobile Database编写一个Android应用程序。 在“调试”或“发布”模式下构建没有问题。 :-) 我想使用自动化测试。几个月前没问题。 但是我恢复了该项目,现在,我无法构建它! 我遇到以下错误仅用于测试。编译工作在“调试”或“发布”模式下!)

Unhandled Error Error: Command Failed:
/node/NodeJS/sales.packages/sales.dev6.1.0.10131405.4884/libs/../node_modules/phantomjs-1.9.7-linux-x86_64/bin/phantomjs
/node/NodeJS/sales.packages/sales.dev6.1.0.10131405.4884/node_modules/html5-to-pdf/lib-phantom/html5-to-pdf.js
/tmp/tmp-96609fwa8zxt.j8r27qfr.html
/tmp/tmp-966091h65wl2.d81714i.pdf
/node/NodeJS/sales.packages/sales.dev6.1.0.10131405.4884/node_modules/html5-to-pdf
/node/NodeJS/sales.packages/sales.dev6.1.0.10131405.4884/node_modules/html5-to-pdf/pdf.css
/node/NodeJS/sales.packages/sales.dev6.1.0.10131405.4884/node_modules/html5-to-pdf/highlight.css
A4 portrait 1.5cm 500 html5bp
    PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/434f7682-c431-9f73-6a83851c-550f411e.dmp
    
        at ChildProcess.exithandler (child_process.js:204:12)
        at emitTwo (events.js:106:13)
        at ChildProcess.emit (events.js:191:7)
        at maybeClose (internal/child_process.js:886:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

我不明白为什么:-( 请帮忙!

  • Android Studio 4.0
  • Java
  • 领域6.0.2
  • 3.4.2级
  • testInstrumentationRunner自定义类扩展了AndroidJUnitRunner

测试的实现:

Build: faild.
Cause: realmSet$myObjectField (my.package.my.Object) not found in my.package.other.Object

(我尝试更新lib版本-例如:androidx.test:core:1.2.1而不是androidx.test:core:1.2.1-alpha02-但我有相同的错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)