Android Question classdefnotfounderror when compiled by slc

SPKM

New Member
Hello Friends,
For a testing purpose, I made a library (.AAR) in Android Studio and compiled a helper lib with slc referencing it and made a test app using B4A. The code compiles fine but a runtime error (classdefnotfounderror ) occurs saying that the class MainActivity could not be found. the class MainActivity is the only activity in the referenced arr lib. I unzipped the apk file and found that the class was there. Please help.
Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Better to post the error message from the logs.

Don't include activities in your library. This is not the cause of this specific error, but it is not recommended.
SLC doesn't work with AARs. You need to extract the internal jar.

I don't recommend creating Java libraries at all. In most cases it is better to create b4xlibs.
 
Upvote 0
Top