I'm learning slc tool, according to SLC FirstLib example it works well. I want to add a member and 2 methods-set ,get. SLC compiled is successfully, but the xml seems to have some problems. B4A refreshing library reports Error parsing libraries - Object reference not set to an instance of an object.
SLC version is 1.11, JDK11
FirstLib.java
Compiler logs
FirstLib.xml
They seem not to generate method in the xml, just a property.If I give method a type and parameters, the xml file will be ok.
SLC version is 1.11, JDK11
FirstLib.java
Java:
package b4x.example;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
@Version(1.0f)
//@Permissions(values={"android.permission.INTERNET"})
@ShortName("FirstLib")
//@DependsOn(values={"some java library "})
//@ActivityObject
public class FirstLib {
private String a;
public int add(int x, int y) { // ok
return x + y;
}
public int sub(int x, int y) { // ok
return x - y;
}
public void set(String x) { // Genrated xml is incorrect
this.a = x;
}
public String get() { // Genrated xml is incorrect
return this.a;
}
}
Compiler logs
B4X:
Starting step: Compiling Java code.
javac 11-ea
[0x7FF9276D6700] ANOMALY: meaningless REX prefix used
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
���ڼ���Դ�ļ�D:\B4X\SimpleLibraryCompiler\FirstLibrary\src\b4x\example\FirstLib.java...
���ڹ��� Javadoc ��Ϣ...
[-doclet, BADoclet]
[-docletpath, D:\B4X\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, D:\B4X\SimpleLibraryCompiler]
[-bootclasspath, D:\software\B4A\android\platforms\android-30\android.jar]
[-classpath, d:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;d:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;D:\B4X\SimpleLibraryCompiler\FirstLibrary\libs\android.jar;D:\B4X\SimpleLibraryCompiler\FirstLibrary\libs\B4AShared.jar;D:\B4X\SimpleLibraryCompiler\FirstLibrary\libs\Core.jar;]
[-sourcepath, src]
[-b4atarget, D:\B4X\B4A\AdditionlLibraries\FirstLib.xml]
[-b4aignore, org,com.android,com.example,com.hoho]
Ignoring: [org, com.android, com.example, com.hoho]
starting....
Working with class: b4x.example.FirstLib
finish: D:\B4X\B4A\AdditionlLibraries\FirstLib.xml
[0x7FF9276D6700] ANOMALY: meaningless REX prefix used
Completed successfully.
*** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
FirstLib.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<doclet-version-NOT-library-version>1.07</doclet-version-NOT-library-version>
<class>
<name>b4x.example.FirstLib</name>
<shortname>FirstLib</shortname>
<owner>process</owner>
<method>
<name>add</name>
<comment></comment>
<returntype>int</returntype>
<parameter>
<name>x</name>
<type>int</type>
</parameter>
<parameter>
<name>y</name>
<type>int</type>
</parameter>
</method>
<method>
<name>sub</name>
<comment></comment>
<returntype>int</returntype>
<parameter>
<name>x</name>
<type>int</type>
</parameter>
<parameter>
<name>y</name>
<type>int</type>
</parameter>
</method>
<property>
<name></name>
<returntype>java.lang.String</returntype>
<parameter>
<name>x</name>
<type>java.lang.String</type>
</parameter>
<comment></comment>
</property>
</class>
<version>1.0</version>
</root>
They seem not to generate method in the xml, just a property.If I give method a type and parameters, the xml file will be ok.
Last edited: