关于引用Eclipse Paho Android Service时的编译class冲突

2020-11-06 10:17:03 浏览数 (1)

按照官方文档:

代码语言:txt复制
dependencies {

    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
    implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.0.2'
}

编译时发生冲突:

代码语言:txt复制
Duplicate class androidx.viewpager.widget.ViewPager$SimpleOnPageChangeListener found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0)

原因是官方文档没有及时更新,这个bug已经在新版本被修正:

代码语言:txt复制
dependencies {

    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.4'
    implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
}

0 人点赞