Build failed with mozilla rhino dependency

Hi! I try to build our application with mozilla rhino dependency

compile group: 'org.mozilla', name: 'rhino', version: ''

I think problem is here:

dex2oat F 57679 2494359 /Volumes/SSD/gh-moe-master/aosp/art/compiler/]Unexpected failure to resolve a method: 
void$1.<init>(, javax.swing.JPanel, javax.swing.JToolBar, javax.swing.JPanel,, javax.swing.JToolBar, javax.swing.JPanel, javax.swing.JSplitPane)dex2oat F 57679 2494359 /Volumes/SSD/gh-moe-master/aosp/art/compiler/] java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

I dont use these javax.swing.* /* classes in my app.
So, how can I avoid that problems?

Dear zufarfakhurtdinov,

this may come from Rhino having a static void main(String[]) method in one of its classes. In the default proguard configuration file there is the following rule which would cause it to be kept:

-keepclasseswithmembers public class * {
    public static void main(java.lang.String[]);

If Rhino’s main method even indirectly references these swing classes, then because of this rule, ProGuard will try to keep it.

To work around this issue, do the following:

  • Copy the ~/.moe/moe-sdk-1.1.0/tools/proguard.cfg file into your MOE module’s directory (do not rename it to proguard.append.cfg)
  • Change the above rule from public class * to public class your.main.ClassName

This way only the main method of your class will be kept.