Search code examples
androidaar

I added *.aar to my project ,when I run it the project runs well but I get error when starting activity , how to solve it?


The aar worked fine as a project then I convert it to library module and added it to a simple project to test if it works properly

the error :

"java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;"

I already added the Gson to aar .but it gives me this error when starting activity (which is inside aar)

The error

how to solve it?


Solution

  • the solution is to add "implementation 'com.google.code.gson:gson:2.8.5'" to the test project , this solved my problem but I don't like it anyway ;)