GetStream / stream-chat-android

:speech_balloon: Android Chat SDK ➜ Stream Chat API. UI component libraries for chat apps. Kotlin & Jetpack Compose messaging SDK for Android chat
https://getstream.io/chat/sdk/android/
Other
1.45k stars 272 forks source link

rearrange channels with the arriving of new message at the top when custom channel holder factory is used #971

Closed abhirup-patra closed 3 years ago

tschellenbach commented 3 years ago

Can you share details about this issue? Which version is impacted? If you run the latest sample you'll see the order of channels update as new messages arrive

abhirup-patra commented 3 years ago

When trying to compile the latest version. This is the error that is getting thrown

AGPBI: {"kind":"error","text":"Android resource compilation failed","sources":[{"file":"/home/nav15/.gradle/caches/transforms-2/files-2.1/62cba4563374727082b731199504ee84/jetified-stream-chat-android-ui-components-4.4.6/res/values/values.xml","position":{"startLine":136,"startColumn":4,"startOffset":8503,"endColumn":99,"endOffset":8598}}],"original":"/home/nav15/.gradle/caches/transforms-2/files-2.1/62cba4563374727082b731199504ee84/jetified-stream-chat-android-ui-components-4.4.6/res/values/values.xml:137:5-100: AAPT: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted=\"false\" attribute?.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource compilation failed","sources":[{"file":"/home/nav15/.gradle/caches/transforms-2/files-2.1/a833072a5d45e77c166f202f8af2ae81/material-1.3.0-alpha04/res/values/values.xml","position":{"startLine":3672,"startColumn":4,"startOffset":233232,"endLine":3678,"endColumn":22,"endOffset":233520}}],"original":"/home/nav15/.gradle/caches/transforms-2/files-2.1/a833072a5d45e77c166f202f8af2ae81/material-1.3.0-alpha04/res/values/values.xml:3673:5-3679:23: AAPT: error: duplicate value for resource 'attr/values' with config ''.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource compilation failed","sources":[{"file":"/home/nav15/.gradle/caches/transforms-2/files-2.1/a833072a5d45e77c166f202f8af2ae81/material-1.3.0-alpha04/res/values/values.xml","position":{"startLine":3672,"startColumn":4,"startOffset":233232,"endLine":3678,"endColumn":22,"endOffset":233520}}],"original":"/home/nav15/.gradle/caches/transforms-2/files-2.1/a833072a5d45e77c166f202f8af2ae81/material-1.3.0-alpha04/res/values/values.xml:3673:5-3679:23: AAPT: error: resource previously defined here.\n    ","tool":"AAPT"}

This worked flawlessly in 4.4.1 version. No such duplicate issue cropped up previously

JcMinarro commented 3 years ago

Hi @abhirup-patra Could you share with use your build.gradle? By some reason it seems that you are not adding our dependency properly

abhirup-patra commented 3 years ago

Sure.. Here it is. i am using 4.4.1 here as this build is working fine. as soon as i change it to the latest build that error is thrown

dependencies {
    def lifecycle_version = "1.1.1"
    def retrofit_version = "2.6.0"
    def okhttp_version = "3.9.0"
    def glide_version = "4.9.0";
    def support_version = "28.0.0"
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

    // crashlytics abhirup
//    implementation 'com.google.firebase:firebase-analytics:17.5.0'
//    implementation 'com.google.firebase:firebase-crashlytics:17.2.2'

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'

    /* implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"*/
    implementation("com.squareup.retrofit2:retrofit:$retrofit_version") {
        // exclude Retrofit’s OkHttp dependency module and define your own module import
        exclude module: 'okhttp'
    }

    implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
    implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
    implementation "com.squareup.retrofit2:converter-scalars:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    //implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.android.material:material:1.2.0-alpha05'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.google.android.play:core:1.7.3'

    //play store updation
    implementation 'org.jsoup:jsoup:1.10.2'

    implementation 'com.karumi:dexter:4.2.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation "com.github.bumptech.glide:glide:$glide_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"
    implementation 'com.google.firebase:firebase-messaging:20.1.0'
    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'androidx.multidex:multidex:2.0.1'
    // implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'

    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'

    // circular image view
    implementation 'de.hdodenhof:circleimageview:3.0.0'

    //shimmer
    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'

    //Google Play services
    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    implementation 'com.google.android.gms:play-services-location:17.0.0'
//implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation('com.google.android.libraries.places:places:1.1.0') {
        exclude module: 'glide'
    }

    //Facebook
    // implementation 'com.facebook.android:facebook-login:[5,6)'
    implementation "com.facebook.android:facebook-android-sdk:5.11.0"

    //Tinder Like Swipe View Libary
    implementation 'com.github.Yalantis:Koloda-Android:v0.0.2-alpha'
    //Animation
    implementation 'com.daimajia.easing:library:2.0@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'

    //algolia
    implementation 'com.algolia:algoliasearch-android:3.+@aar'

    implementation 'com.algolia:instantsearch-android:1.13.0'
    implementation 'com.shuhart.bubblepagerindicator:bubblepagerindicator:1.1.2'
    //SeekBar
    implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
    //Range Seekbar
    implementation('com.github.Innovattic:range-seek-bar:v1.0.6') {
        exclude module: 'glide'
    }
    // This will automatically update to the latest v1 release when you build.
    //File Compressor
    implementation 'id.zelory:compressor:2.1.0'
    // This will automatically update to the latest v1 release when you build.

    implementation 'com.github.aakira:expandable-layout:1.6.0@aar'
    //expandable layout implementation for tags

    implementation 'com.google.android:flexbox:0.3.1'

    //Crop
    implementation 'com.github.yalantis:ucrop:2.2.2'

    //loaderButton
//    implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'

    //gif loader
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'

    //horizontally overlapped circular images.
    implementation 'com.kartik.stackimageview:stackimageview:0.0.2'

    //mp android chart
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

    /* GetStream:stream-chat*/
    // api 'com.github.GetStream:stream-chat-android-client:1.0.12'
    //  implementation 'com.github.bumptech.glide:glide:4.9.0'
//    implementation 'com.github.GetStream:stream-chat-android:4.0.13'
    implementation 'com.github.GetStream:stream-chat-android:4.4.1'
    //implementation 'com.github.GetStream:stream-chat-android-livedata:0.3.0'

    // pusher
//    implementation 'com.pusher:chatkit-android:1.3.3'
    implementation "me.leolin:ShortcutBadger:1.1.22@aar"

    implementation 'com.google.firebase:firebase-messaging-directboot:20.3.0'

    //Socket
    implementation('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

}
JcMinarro commented 3 years ago

Ok, I can see you are using our old Jitpack repository that is not the oficial one anymore. We migrated to MavenCentral from some version ago. To use the new artifacts, first you need to check that you are using MavenCentral as dependencies repository:

repositories {
    mavenCentral()
    ...
}

Then include the new dependency artifact, note that the groupId has be changed to io.getstream:

dependencies {
    implementation "io.getstream:stream-chat-android:4.4.6"
    ...
}
abhirup-patra commented 3 years ago

I am using mavelCentral(). Still the problem persists

zsmb13 commented 3 years ago

Having mavenCentral() in your repositories isn't enough on its own, you also have to use the correct artifact, as commented above.

In your build.gradle config that you posted above, you had this line:

implementation 'com.github.GetStream:stream-chat-android:4.4.1'

That will fetch the library from Jitpack. Please replace that line with this to get the latest version of the library from MavenCentral:

implementation "io.getstream:stream-chat-android:4.4.6"