Arun Ganessh
Arun Ganessh

Reputation: 91

javax.jmdns lib is not getting imported.How to make the error clear?

These imports are showing error

import javax.jmdns.JmmDNS;
import javax.jmdns.NetworkTopologyDiscovery;
import javax.jmdns.ServiceEvent;
import javax.jmdns.ServiceInfo;
import javax.jmdns.ServiceListener;
import javax.jmdns.impl.NetworkTopologyDiscoveryImpl;

How to clear those errors

Upvotes: 0

Views: 862

Answers (1)

Luís Henriques
Luís Henriques

Reputation: 634

If you don't need them, just delete those lines.

If you do need them, import what you need.

Go to your build.gradle (module:app) and under "dependencies" add the libraries you need.

dependencies {

    // Android support
    implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
    implementation "com.android.support:design:$supportLibraryVersion"
    implementation "com.android.support:support-v13:$supportLibraryVersion"
    implementation "com.android.support:percent:$supportLibraryVersion"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'

}

You can also search for those libraries in the Maven Repository.

Here's the example for your first import:

https://mvnrepository.com/artifact/javax.jmdns/jmdns/3.2.2

Under the "Gradle" tab you can see that you can import it by writing:

implementation group: 'javax.jmdns', name: 'jmdns', version: '3.2.2'

Upvotes: 0

Related Questions