Mr.Rao
Mr.Rao

Reputation: 331

Custom written Class not found when using aar library

I am writing a library. When I include it as a module dependency inside the same project, the app works. If i generate aar file and include it libs folder, I am getting java.lang.NoClassDefFoundError. What is stranger is that the class is written by me and is inside the library. It is not external library class. The following error is thrown from inside the library.

java.lang.NoClassDefFoundError: com.pacakge.ChatView$5
   at com.packge.ChatView.someFunction(ChatView.java:190)

at line 190, I am calling a static method of another class which is inside my library. Please help me understand why am I getting this error.

Upvotes: 0

Views: 562

Answers (1)

Mr.Rao
Mr.Rao

Reputation: 331

It wasn't about the class which i had written. In the same line, there was a reference to the class which was from volly library, and volley was not added as the dependency in my app. Apparently, all the dependencies in library's gradle have to be added in the app's gradle as well.

Upvotes: 1

Related Questions