Option 1
Following worked for me
Add the following in your gradle.properties file
android.useAndroidX = true
android.enableJetifier = false
Option 2 (if above does't work)
Android studio
-> Navigate
-> Class
- Check include non-project classes
- Copy full class path android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat
- See where it is used. You may need to remove, one of them.
Option 3
you might be including package which is including modules as well so exclude the support-v4 module with following method
implementation ('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
You can analyze the conflicting modules using ./gradlew :YOURPROJECT:dependencies
from a command line in your project repository.
Check especially your third party libraries for occurences of "com.android.support-":
Then exclude the conflicting modules from these dependencies like:
implementation ("com.jakewharton:butterknife:8.8.1") {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotation'
exclude group: 'com.android.support', module: 'support-compat'
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…