Bug? IllegalArgumentException

Discussion in 'Bugs & wishlist' started by wimpie3, Mar 28, 2019.

  1. wimpie3

    wimpie3 Well-Known Member Licensed User

    Not sure this is a bug but this problem turned up right after switching to B4A v9:
    Code:
    Convert byte code - optimized dex.    Error
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$attr;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$color;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$dimen;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$drawable;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$
    id;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$integer;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$layout;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/compat/R$
    string;
    UNEXPECTED TOP-LEVEL 
    EXCEPTION:
    java.lang.RuntimeException: Translation has been interrupted
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    696)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    315)
        at com.android.dx.command.dexer.Main.runDx(Main.java:
    293)
        at com.android.dx.command.dexer.Main.main(Main.java:
    249)
        at com.android.dx.command.Main.main(Main.java:
    94)
    Caused by: java.lang.InterruptedException: Too many errors
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    688)
        ... 
    4 more
    This happens when I call a module that has been precompiled in B4A using "compile to library".
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    A compiled library shouldn't include a class named: android/support/compat/R

    You are probably using a library that mistakenly embedded these classes.
     
  3. wimpie3

    wimpie3 Well-Known Member Licensed User

    I've manually removed the android directory from the JAR file B4A created, and now it works. But this means each and every time I touch the compiled library, I have to remove those files :-(

    I did some further research, and as soon as I include Amir_Recycleview and use "Compile To A Library", an android directory is added in the JAR file which causes those conflicts.
     
    Last edited: Mar 28, 2019
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice