cometchat / chat-sdk-android

Text Chat SDK for Android
https://www.cometchat.com
22 stars 12 forks source link

Call and video keep crashing #13

Closed aldrek closed 5 years ago

aldrek commented 5 years ago

E/unknown:ViewManager: Error while updating prop source java.lang.reflect.InvocationTargetException

java.lang.NoSuchMethodError: No virtual method diskCacheStrategy(Lcom/bumptech/glide/load/engine/DiskCacheStrategy;)Lcom/bumptech/glide/request/RequestOptions; in class Lcom/bumptech/glide/request/RequestOptions; or its super classes (declaration of ‘com.bumptech.glide.request.RequestOptions’ appears in /data/app/icode.com.doctory-nM3hIEL9oDSrgRRU5_V31g==/base.apk) at com.dylanvann.fastimage.FastImageViewConverter.getOptions

adityagokula2210 commented 5 years ago

Hello @Ahmadgsalman We have identified the issue. The issue is caused due to multiple version of glide dependency downloaded transitively from various other dependencies. Due to which gradle is always taking the latest version of glide which is available from the dependencies. The ideal solution here is to force gradle to use a specific version of the glide dependency. In your case, I would suggest you use the version 4.8.0 as the latest version 4.9.0 has some major changes that do not support backward compatibility. Please add the below line of code to the android section of the app level gradle file:

android {
    configurations.all {
        resolutionStrategy.force 'com.github.bumptech.glide:glide:4.8.0'
    }
}

This should resolve the issue you are facing with respect to calling. Also, I suggest you use the latest version of the CometChat SDK (1.8.6) which includes certain minor fixes with respect to calling and other features. Please let us know if this works. Thanks, Aditya Gokula

aldyrpl commented 5 years ago

not working, keep crashing when calling

adityagokula2210 commented 5 years ago

@aldyrpl Can you please share your Gradle file here so that I can have a look at the same. I will try creating a sample app with the same gradle file and test the same at my end.

aldyrpl commented 5 years ago

apply plugin: 'com.android.application'

android { lintOptions {

    checkReleaseBuilds false

}
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
    applicationId "com.unilever.go.walls"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 2006
    versionName "2.6"
    multiDexEnabled true
    renderscriptSupportModeEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }

}
buildTypes {
    release {
        minifyEnabled false
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable true
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' implementation "com.cometchat:pro-ext-pn:1.0.+" androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:cardview-v7:28.0.0' implementation 'com.android.support:support-emoji-appcompat:28.0.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17' implementation 'com.android.support:support-annotations:28.0.0' implementation 'com.github.bumptech.glide:glide:4.8.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' implementation 'com.airbnb.android:lottie:2.7.0' //cometchat sdk implementation 'com.cometchat:pro-android-chat-sdk:1.8.6' implementation 'com.github.AppIntro:AppIntro:4.2.3' implementation 'com.android.support:recyclerview-selection:28.0.0'

implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
// dexter runtime permissions
implementation 'com.karumi:dexter:4.2.0'
implementation 'com.google.firebase:firebase-core:16.0.8'

}

repositories { mavenCentral() maven { url 'https://jitpack.io' } }

configurations { all { exclude group: 'xpp3', module: 'xpp3' resolutionStrategy.force 'com.github.bumptech.glide:glide:4.8.0' }

apply plugin: 'com.google.gms.google-services'

}

adityagokula2210 commented 5 years ago

@aldyrpl Can you pelase add the below lines to the android section of the app level gradle file:

configurations.all { resolutionStrategy.force 'com.github.bumptech.glide:glide:4.8.0' } and then try running the app..

adityagokula2210 commented 5 years ago

Sorry. I see you have already added the lines. Can you make sure the error is the same that was occurring earlier

adityagokula2210 commented 5 years ago

@Ahmadgsalman @aldyrpl Please let us know if this is issue has been resolved so that I can close this issue.

Thanks