Well, let's go.
First my goal is to use a second lib (file.jar) in the current lib that I am creating, so far so good, as I said earlier everything works both in the Eclipse IDE and in my created .jar file. In the first few lines of my original program I create an instance of that lib that I need to use.
package anywheresoftware.b4a;
import anywheresoftware.b4a.BA.ShortName;
import testeLib.PrintDays;
@ShortName("Days")
public class Days {
static PrintDays printDays = new PrintDays();
public Days() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(Terca());
}
public String Segunda() {
return "Segunda-Feira";
}
public static String Terca() {
return PrintDays.Terca();
}
public String Quarta() {
return printDays.Quarta();
}
public String Quinta() {
return printDays.Quinta();
}
public String Sexta() {
return printDays.Quinta();
}
}
When trying to use in B4A, when I go to the Activity that uses that lib, the application breaks and shows the following ERROR.
java.lang.NoClassDefFoundError: Failed resolution of: LtesteLib/PrintDays;
Caused by: java.lang.ClassNotFoundException: Didn't find class "testeLib.PrintDays" on path: DexPathList[[zip file "/data/app/b4a.example-PxT5hY7ucGYgL6j9VqlFUg==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-PxT5hY7ucGYgL6j9VqlFUg==/lib/arm, /system/lib, /vendor/lib]]
I found a 2014 publication similar to this issue (
NoClassDefFoundError Problem ) , where the only thing that is changed is the Java Compiler from 1.7 (in my case 1.8) to 1.6, however it still doesn't work. Whenever I use lib, this NoClassDefFoundError error appears and breaks the application.