Home > Software engineering >  Class not resolved when implementing custom library in Gradle Android
Class not resolved when implementing custom library in Gradle Android

Time:11-25

I have created an android library and published it in Jitpack.

Currently, my build is getting success in Jitpack. but when I add the implementation URL in my project build Gradle gets success but when I try to use library classes it does not get resolved

In the external library tab located in the project structure, it does not have the library which I have implemented so might be .jar file is not getting generated.

Help me If you have any solution or any way to identify this issue.

CodePudding user response:

If I understand correctly you say that the gradle build or 'project sync' after a change in the gradle files works fine. But you cannot use any of the code from your library.

Can you verify that your library is loaded in the External Libraries? It would be something with your repository name in it and ends with '@aar' (eg. com.github.nickname:libraryname:version@aar)

If you cannot find it, please check if your library module build.gradle has the line below somewhere at the top of the file.

apply plugin: 'com.android.library'

CodePudding user response:

The issue was the Repository was private so we need to provide an authentication token. The reference link is given below

https://jitpack.io/docs/PRIVATE/

  • Related