samedi 28 juillet 2018

java.lang.NoClassDefFoundError: org.mozilla.javascript.tools.debugger.treetable.JTreeTable

I encounter below exception when running android instrumentation test under all module. FYI, tested with both 'org.mozilla:rhino:1.7.7' & 'org.mozilla:rhino:1.7.9' latest version.Happens only when running instrumentation test. App running with no issue.

Logcat captured :

`07-27 23:39:22.208 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.assertj.core.internal.cglib.transform.AbstractProcessTask 07-27 23:39:22.209 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:22.210 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.assertj.core.internal.cglib.transform.AbstractTransformTask 07-27 23:39:24.035 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.036 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.036 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.ContextWindow 07-27 23:39:24.040 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.040 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.EvalTextArea 07-27 23:39:24.042 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.042 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.EvalWindow 07-27 23:39:24.043 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.044 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.Evaluator 07-27 23:39:24.045 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.046 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.046 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.FileHeader 07-27 23:39:24.047 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.047 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.FilePopupMenu 07-27 23:39:24.048 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.049 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.FileTextArea 07-27 23:39:24.050 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.055 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.056 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.FileWindow 07-27 23:39:24.057 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.057 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.FindFunction 07-27 23:39:24.058 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.058 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.JSInternalConsole 07-27 23:39:24.060 19504-19583/com.xxx.xxx.xxx.test W/AndroidJUnit4Builder: java.lang.NoClassDefFoundError: java.awt.Dimension in hasTestMethods for org.mozilla.javascript.tools.debugger.Main 07-27 23:39:24.070 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.071 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.071 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.Menubar 07-27 23:39:24.072 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.072 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.MoreWindows 07-27 23:39:24.073 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.073 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.MyTableModel 07-27 23:39:24.073 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.074 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.074 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.MyTreeTable 07-27 23:39:24.076 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.076 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.SwingGui 07-27 23:39:24.077 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.078 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.078 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.VariableModel 07-27 23:39:24.079 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class Rejecting re-init on previously-failed class java.lang.Class 07-27 23:39:24.079 19504-19583/com.xxx.xxx.xxx.test E/TestLoader: Could not find class: org.mozilla.javascript.tools.debugger.treetable.AbstractCellEditor 07-27 23:39:24.079 19504-19583/com.xxx.xxx.xxx.test I/art: Rejecting re-init on previously-failed class java.lang.Class

java.lang.NoClassDefFoundError: org.mozilla.javascript.tools.debugger.treetable.JTreeTable at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:309) at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:76) at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:110) at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:809) at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:487) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:373) at com.xxx.support.test.xxxTestRunner.onStart(xxxTestRunner.java:13) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853) 07-27 21:47:04.930 1084-2189/system_process W/ActivityManager: Error in app com.xxx.xxx.xx.test running instrumentation ComponentInfo{com.xxx.xxx.xxx.test/com.xxx.xxx.xxx.xxxTestRunner}: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: org.mozilla.javascript.tools.debugger.treetable.JTreeTable`

If remove implementation 'org.mozilla:rhino:1.7.7' in build grade and remove all javascript execution, the test is running with no issue. Tested with Android 6.0,5.1.1 devices.


test set up

After a lot of trying, fount out that when running test under "all in module" selection will throw above classNoFound issue; but when running with "all in package" selection and specific the package path, instrumentation test run with no issue.

Aucun commentaire:

Enregistrer un commentaire