Closed imayank91 closed 5 years ago
Hello @imayank91
We have already made the changes and now we have removed the jar files for okttp and okio and have added them as Gradle dependencies. So that in case there is conflict, you can easily exclude the okio dependency. This change will be live in the next version of the CometChat Pro android SDK which is 1.8.0 scheduled to go live in a couple of days or latest by early next week. If you wish, you can use the beta version beta-1.7.1
where the changes have been done.
We will let you know once version 1.8.0 is live.
Hope this helps. Thanks.
I tried using the beta-1.7.1, throws an error "The given artifact contains a string literal with a package reference 'android.support.v4.widget' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx."
I think the library is still using the android support library instead of androidx
Are you using butterknife? You need to update the version of that so that I can get rid of this error
Hello @imayank91 We are not using butterknife in our SDK. Can you please share your build.gradle file so that I can have a look at what is causing the conflict.
Thanks
Here you go
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.core:core-ktx:$ktx_version"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
testImplementation 'junit:junit:4.12'
//Espresso
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//cometchat sdk
implementation ('com.cometchat:pro-android-chat-sdk:beta-1.7.1') {
exclude module:'org.xmlpull.v1'
}
//Mockito
// androidTestImplementation "org.mockito:mockito-core:2.23.4"
// androidTestImplementation "org.mockito:mockito-android:2.23.0"
androidTestImplementation 'org.mockito:mockito-android:2.+'
implementation "org.mockito:mockito-core:2.+"
// androidTestImplementation"net.bytebuddy:byte-buddy:1.9.10"
// androidTestImplementation "net.bytebuddy:byte-buddy-agent:1.9.10"
// androidTestImplementation "net.bytebuddy:byte-buddy-android:1.9.7"
// Core library
implementation 'androidx.test:core:1.2.0'
// AndroidJUnitRunner and JUnit Rules
testImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
testImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
//Change it back
//implementation 'androidx.test:runner:1.2.0'
//implementation 'androidx.test:rules:1.2.0'
// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:truth:1.2.0'
androidTestImplementation 'com.google.truth:truth:0.42'
//Roboelectric
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation "org.robolectric:shadows-support-v4:3.0"
//Test Implementation
testImplementation 'androidx.test:runner:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
implementation 'androidx.fragment:fragment-testing:1.1.0-alpha07'
//intuit
implementation "com.intuit.sdp:sdp-android:$intuit_version"
implementation "com.intuit.ssp:ssp-android:$intuit_version"
//Navigation components
implementation "androidx.navigation:navigation-fragment-ktx:$navigationktx_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigationktx_version"
//Legacy Support
implementation "androidx.legacy:legacy-support-v4:$legacysupport_version"
//View Model
androidTestImplementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
//Design Library
implementation 'com.google.android.material:material:1.1.0-alpha07'
//Lottie
// implementation "com.airbnb.android:lottie:3.0.6"
implementation ("com.airbnb.android:lottie:3.0.6") {
exclude group: 'com.squareup.okio'
}
@imayank91 Can you also paste the stacktrace of the error that you are getting..?
The given artifact contains a string literal with a package reference 'android.support.v4.widget' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.
@imayank91 Can you try excluding the 'android.support.v4.widget' dependency from the CometChat dependency by adding the below line to the CometChat dependency implementation ('com.cometchat:pro-android-chat-sdk:beta-1.7.1') { exclude module: 'support-v4' }
Thanks
No luck, it's the same
I was able to solve this for now using
android.jetifier.blacklist = support-v4
Do you have a plan to migrate the sdk from v4 to androidx.
@imayank91 Yes. We have added it to our task list and will take it up as soon as possible. Thank you for pointing this out.
Thanks.
I have multiple sdk's which use the latest version of okio dependency. As cometchat-pro uses okio as a jar file there's no way I can exclude it. If you can please rev the okio version and release it, it would be very helpful
Duplicate class okio.AsyncTimeout found in modules okio-1.15.0.jar (com.cometchat:pro-android-chat-sdk:1.7.0) and okio-1.17.4.jar (com.squareup.okio:okio:1.17.4)