Reputation: 1
I don't know what is causing this error or what does it mean, but I guess it comes from the gradle file and has something to do with the SDK version.
The full error: Program type already present: android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl
And the gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "27.0.3"
repositories {
maven {
url "https://repo.eclipse.org/content/repositories/paho-snapshots/"
}
}
defaultConfig {
applicationId "org.eclipse.paho.android.service.sample"
minSdkVersion 11
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.android.support:support-v4:19.0.0'
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.0.2'
}
Upvotes: 0
Views: 5552
Reputation: 1
I finally found the solution:
Exclude the module support-v4 in the last dependency, as @Ruan_Lopes said, but don't exclude the group.
Upvotes: 0
Reputation: 1399
That is happening because the paho library already have the support v4.
You can also check it by running gradle -q dependencies in the command line to generate a dependency report. You should see where support v4 is coming from.
Finally exclude the library from that specific dependency as such:
dependencies {
implementation 'com.android.support:support-v4:19.0.0'
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
implementation ('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
Upvotes: 1