Android Question Problem with Simple Library Compiler

Discussion in 'Android Questions' started by pas, Jul 1, 2019.

  1. pas

    pas Member Licensed User

    This is my first time attempting to create an SDK wrapper for B4A.
    The Simple Library Compiler (v1.10) looks like the perfect solution but from what I can tell it is not working for me.
    I simply unzip it and attempt to build the FirstLib sample.
    No errors are shown during the compile step but I am not able to include FirstLib in a B4A project without getting this error:

    Error description: Unknown type: firstlib
    Are you missing a library reference?

    The firstlib library is included and I have performed the refresh operation.

    I think the issue may be in the generated XML file, it looks like this:

    <?xml version="1.0" encoding="UTF-8"?>

    Should it have the xml definition for the class and method?

    Thank you for any help.
  2. DonManfred

    DonManfred Expert Licensed User

    Post the output of the compilation window in SLC

    It looks like this when i compile the FirstLibrary

    The XML generated is:

    Last edited: Jul 2, 2019
  3. pas

    pas Member Licensed User

    Thank you Don.
    There are definitely differences between your output and mine, this line in your output jumps out: Working with class: com.example.FirstLib
    If you have any ideas it would be greatly appreciated.

    Starting step: Compiling Java code.
    Completed successfully.
    step: Creating jar file.
    Completed successfully.
    step: Creating XML file.
    Loading source 
    file C:\tmp\SimpleLibraryCompiler\FirstLibrary\src\com\example\
    Constructing Javadoc information...
    [-doclet, BADoclet]
    [-docletpath, C:\tmp\SimpleLibraryCompiler]
    [-doclet, BADoclet]
    [-docletpath, C:\tmp\SimpleLibraryCompiler]
    [-bootclasspath, C:\Users\PaulSerotta\AppData\Local\Android\Sdk\platforms\android-
    [-classpath, C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;]
    [-sourcepath, src]
    [-b4atarget, C:\tmp\libs\FirstLib.xml]
    [-b4aignore, org,,com.example,com.hoho]
    Ignoring: [org,, com.example, com.hoho]
    finish: C:\tmp\libs\FirstLib.xml

    Completed successfully.
    *** Don
    't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
  4. agraham

    agraham Expert Licensed User

    An error seems to have crept into the example zip over the years. The xml file is empty because the default setting for -b4aignore includes 'com.example' and as you are compiling a 'com.example' class it is ignored. If will work if you remove 'com.example' from -b4aignore.
    Erel and DonManfred like this.
  5. DonManfred

    DonManfred Expert Licensed User

    Good catch!
    agraham likes this.
  6. pas

    pas Member Licensed User

    Thank you so much that fixed the problem! Perhaps the sample can be corrected at some point so others don't hit it too.
  7. Erel

    Erel Administrator Staff Member Licensed User

  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