Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Could not import a dependency in Kotlin project using Gradle

I would like to use a third-party library in Kotlin project.

settings.gradle:

...
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}
...

build.gradle in app directory:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

...
dependencies {
    ...
    implementation 'com.github.delight-im:Android-AdvancedWebView:v3.2.1'
    ...
}
...

MainActivity.kt:

...
private lateinit var webView: im.delight.android.webview.AdvancedWebView
...

The compiler is unable to find im.delight.android.webview.AdvancedWebView.

>Solution :

I’ve tried to build and run app with this code but faced no problem.
Share your error screen please

If you doubt that the dependency works, you can try to download the link directly from the jitpack. All you have to do is grab the github repository link, go to the jitpack.io website and paste the address into the search box.
At the bottom there will be a list of releases, where you will need to click one of the green buttons, copy one of the resulting line and paste in dependcy, like in your description

Read the documentation for the site for details.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading