Android Question java.lang.IllegalArgumentException: already added

Discussion in 'Android Questions' started by Star-Dust, Jun 4, 2019.

  1. Star-Dust

    Star-Dust Expert Licensed User

    I have compiled a library and when I recall it in my app it signals me this error.

    While if I use it as a source it compiles me correctly. Opening the Jar file I find (in DesignScript folder) two files LS_Layout1.class and LS_Layout2.class inside.

    The thing seems strange to me, and I am proposing these files that make me the error.
    I have physically deleted these two files from the jar file and now compiles correctly.

    why do you create these files for me? how do you solve this problem?

    Update:
    This morning I recompiled the library does not create the folder DesignScript . Yesterday, instead, this folder containing these 2 Class created :confused:
     
    Last edited: Jun 5, 2019
  2. Star-Dust

    Star-Dust Expert Licensed User

    It seems that somehow the two layouts I had created gave rise to the two classes in the compilation.

    Classes that were in conflict with the classes created by the Layouts of the App that used the library.

    However today correctly, when I compiled as a library, layouts are ignored and classes are not generated.

    This thing is not the first time that happens to me, that by compiling as a library, I am generated with layout-related classes.
     
  3. Star-Dust

    Star-Dust Expert Licensed User

    The problem is back, I compile a library and I find a class for each layout existing in the project.

    To avoid problems I have to open the Jar file and delete these classes.

    But is it a BUGS?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It does sound like a bug. Does it happen if you clean the project before compiling it as a library?
     
  5. Star-Dust

    Star-Dust Expert Licensed User

    No, cleaning up the project does not show these classes.
    It seems that they appear after I have compiled as an APK and later as a library.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Fixed for the next version. BTW, why aren't you creating b4xlibs? They should be the default format.
     
  7. Star-Dust

    Star-Dust Expert Licensed User

    I answered this question another time. Some libraries want to keep the source code confidential. But at least half of my libraries are made in B4Xlib format.

    I also hope that one day you will add the function that automatically creates the manifest and the compressed file B4XLIb. :p
     
    Erel likes this.
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