Cannot import function/class from Android library published on Jitpack

5 days ago 7
ARTICLE AD BOX

I just created an Android library (check the directory uselesslib, there's a class called MyLib), and published it on Jitpack.

Inside the library's build.gradle.kts, there are these lines:

afterEvaluate { publishing { publications { register<MavenPublication>("release") { from(components["release"]) groupId = "com.github.anta40" artifactId = "uselesslib" version = "0.0.1" } } } }

Now let's create a test project for it. Add this line on build.gradle.kts

dependencies { implementation("com.github.anta40:UselessApp:5c05c0d42f") }

So far no issue with Gradle syncing. Let's try to import it.

enter image description here

Android Studio says "Cannot resolve symbol 'MyLib`". I thought Android Studio could easily resolve this, because MyLib is already provided by the previous implementation on build.gradle.kts.

What's missing here?

Read Entire Article