Android Tutorial [java] Video tutorial - Creating a simple library

Richard Goh

Active Member
Licensed User
Longtime User
Hi,
how do I create / handle a library which class methods with throw exceptions?
I am new to library creation and trying it out but hit into below problem.
I had created the library by following the steps successfully and able the see it in B4A project.
But when I do a compile of my project, it's hit into below error. Any expert advises on this?
Thanks in advance.

B4A version: 6.00
Parsing code. (0.03s)
Compiling code. (0.17s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.27s)
Compiling debugger engine code. (2.05s)
Compiling generated Java code. Error
B4A line: 185
fb.url(\
javac 1.8.0_92
src\comtestop\vregistration.java:676: error: unreported exception FirebaseException; must be caught or declared to be thrown
_fb.url("https://xxx.firebaseio.com/"+_vid);
^
1 error
 
Last edited:

Richard Goh

Active Member
Licensed User
Longtime User
Hi,
how do I create / handle a library which class methods with throw exceptions?
I am new to library creation and trying it out but hit into below problem.
I had created the library by following the steps successfully and able the see it in B4A project.
But when I do a compile of my project, it's hit into below error. Any expert advises on this?
Thanks in advance.

B4A version: 6.00
Parsing code. (0.03s)
Compiling code. (0.17s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.27s)
Compiling debugger engine code. (2.05s)
Compiling generated Java code. Error
B4A line: 185
fb.url(\
javac 1.8.0_92
src\comtestop\vregistration.java:676: error: unreported exception FirebaseException; must be caught or declared to be thrown
_fb.url("https://xxx.firebaseio.com/"+_vid);
^
1 error
I managed to solve the problem by adding try & catch for the methods in my eclipse class methods.
The project compilation successful.

But now hit into another problem "java.lang.NoClassDefFoundError: org.apache.log4j.Logger" when running the programs.
 

DonManfred

Expert
Licensed User
Longtime User
But now hit into another problem
for which you always should create a new thread.

I guess log4j is for JAVA but not especially for Android. You can try to find the code which used this logger.
Maybe you can replace it with logging into the B4A ide...

If not than you need to add the jar for this logger class to your project
 
Top