You need to connect Rhino (JavaScript interpreter) to the application on Android. Gradle is used, the dependency is added without problems:
dependencies { ... compile "org.mozilla:rhino:1.7.7.2" } The problem is that Rhino contains the "tools" package (org.mozilla.javascript.tools), which uses javax.swing classes that are absent on Android, which is why ProGuard swears and does not allow building the application find common super class ... "for a class that uses javax.swing.JInternalFrame and is in an unnecessary package" tools ").
Is it possible to somehow exclude this package from a dependency? Make it so that it is simply ignored during the build and does not end up in the resulting application.
The same question was asked on the Gradle forum, but there were no answers: Exclude package from dependency / runtime repackage dependency
In search of a solution I tried the options:
compile ("org.mozilla:rhino:1.7.7.2") { exclude group: 'org.mozilla.javascript.tools' } and
sourceSets { main { java { exclude 'org/mozilla/javascript/tools/**' } } } but to no avail.
