Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Duplicated title #65

Open
emreakcan opened this issue Nov 7, 2019 · 7 comments
Open

Duplicated title #65

emreakcan opened this issue Nov 7, 2019 · 7 comments

Comments

@emreakcan
Copy link

image

My XML

<com.google.android.material.appbar.AppBarLayout
            android:id="@+id/app_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="@dimen/class_detail_appbar_expanded_height"
            android:background="@color/colorAccentPassive"
            android:elevation="0dp"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:elevation="0dp">

            <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
                android:id="@+id/collapsing_toolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:collapsedTitleTextAppearance="@style/ToolbarCollapsedTextAppearance"
                app:contentScrim="@color/colorPrimary"
                app:expandedTitleMarginBottom="40dp"
                app:expandedTitleMarginStart="@dimen/general_margin"
                app:expandedTitleMarginEnd="100dp"
                app:expandedTitleTextAppearance="@style/ToolbarExpandedTextAppearance"
                app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
                app:maxLines="2">


                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/class_detail_appbar_collapsed_height"
                    android:paddingTop="@dimen/status_bar_height"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                    app:titleTextAppearance="@style/ToolbarExpandedTextAppearance">




                </androidx.appcompat.widget.Toolbar>

            </net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout>

        
        </com.google.android.material.appbar.AppBarLayout>

Any idea why thats happening? not always but it happens for certain texts.

@johan12345
Copy link
Contributor

Hi,

first thing: it seems that you are using our library together with the new Material Components library instead of the newest compatible version of the Android Design Support Library (27.1.1).

As noted in the README file, we are not maintaining this library anymore and updating it for compatibility with new Material Components library versions. but trying to get the changes merged into the official Material Components Android library. (material-components/material-components-android#413) Can you check if this problem still occurs if you try our fork of the Material Components library, where some bugs have already been fixed?

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    // replace the material components library with:
    implementation 'com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT'
}

Then replace net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout back to com.google.android.material.appbar.CollapsingToolbarLayout

If it still occurs there, could you give us an example of a title text with which you see this problem? Could it be that it starts with a tab (\t) or other whitespace character?

@emreakcan
Copy link
Author

@johan12345 thanks for response and sorry for my late question, I got this error by replacing the library.

`FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugDuplicateClasses'.

1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.android.material.animation.AnimationUtils found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.AnimatorSetCompat found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.ArgbEvaluatorCompat found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.ChildrenAlphaProperty found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.DrawableAlphaProperty found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.ImageMatrixProperty found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.MatrixEvaluator found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)
Duplicate class com.google.android.material.animation.MotionSpec found in modules classes.jar (com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT:1.1.0-alpha04-g217380e-941) and classes.jar (com.google.android.material:material:1.0.0)`

@johan12345
Copy link
Contributor

That looks like you still have the Google version of the Material Components library included in your dependencies (com.google.android.material:material:1.0.0). As our version is a fork of that library and thus contains the same classes, it needs to be removed.

@emreakcan
Copy link
Author

@johan12345, I removed and cleaned my project but still gives that error

That looks like you still have the Google version of the Material Components library included in your dependencies (com.google.android.material:material:1.0.0). As our version is a fork of that library and thus contains the same classes, it needs to be removed.

@johan12345
Copy link
Contributor

Hmm, then maybe some other library that you include depends on com.google.android.material:material?

@emreakcan
Copy link
Author

Here is my full gradle, checked but couldn't find

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${rootProject.ext.kotlinVersion}"
    implementation "org.jetbrains.kotlin:kotlin-reflect:${rootProject.ext.kotlinVersion}"
    implementation "androidx.appcompat:appcompat:1.1.0"
    implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.androidxConstraintLayoutVersion}"
    implementation 'com.github.opacapp:material-components-android:multiline-collapsingtoolbar-SNAPSHOT'
    implementation "androidx.multidex:multidex:${rootProject.ext.multidexVersion}"
    api "android.arch.lifecycle:extensions:${rootProject.ext.lifecycleVersion}"
    api "android.arch.lifecycle:common-java8:${rootProject.ext.lifecycleVersion}"
    api "com.google.code.gson:gson:${rootProject.ext.googleGsonVersion}"
    api "com.squareup.retrofit2:retrofit:${rootProject.ext.retrofitVersion}"
    api "com.squareup.retrofit2:converter-gson:${rootProject.ext.retrofitVersion}"
    api "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:${rootProject.ext.retrofitRxJavaAdapterVersion}"
    api "com.squareup.okhttp3:okhttp:${rootProject.ext.okHttpVersion}"
    api "com.squareup.okhttp3:logging-interceptor:${rootProject.ext.loggingInterceptorVersion}"
    api "com.google.firebase:firebase-core:17.2.0"
    api "com.google.firebase:firebase-messaging:20.0.0"
    implementation "com.google.firebase:firebase-crash:${rootProject.ext.firebaseCrashVersion}"
    implementation "com.jakewharton.timber:timber:${rootProject.ext.timberVersion}"
    implementation "com.crashlytics.sdk.android:crashlytics:2.10.1"
    implementation "com.facebook.android:facebook-login:${rootProject.ext.facebookAuthVersion}"
    implementation "io.reactivex.rxjava2:rxandroid:${rootProject.ext.rxandroidVersion}"
    implementation "io.reactivex.rxjava2:rxjava:${rootProject.ext.rxjavaVersion}"
    implementation "com.bluelinelabs:conductor:${rootProject.ext.conductorVersion}"
    implementation "com.bluelinelabs:conductor-support:${rootProject.ext.conductorVersion}"
    implementation "com.rengwuxian.materialedittext:library:${rootProject.ext.materialEditTextVersion}"
    implementation "com.google.firebase:firebase-auth:19.1.0"
    implementation "com.google.android.gms:play-services-auth:17.0.0"
    implementation "com.androidadvance:topsnackbar:${rootProject.ext.topSnackBarVersion}"
    implementation "com.stripe:stripe-android:10.4.3"
    implementation "com.yayandroid:ParallaxRecyclerView:${rootProject.ext.parallaxRecycler}"
    implementation "com.google.android.gms:play-services-places:17.0.0"
    implementation "com.savvi.datepicker:rangepicker:${rootProject.ext.datePickerVersion}"
    implementation "net.opacapp:multiline-collapsingtoolbar:${rootProject.ext.multilineCollapsingToolbar}"
    implementation "at.blogc:expandabletextview:${rootProject.ext.expandableTextViewVersion}"
    implementation "com.github.chrisbanes:PhotoView:${rootProject.ext.photoViewVersion}"
    implementation "io.card:android-sdk:${rootProject.ext.cardIOVersion}"
    implementation "com.google.android.gms:play-services-maps:${rootProject.ext.googleMapVersion}"
    implementation 'com.wefika:horizontal-picker:1.1.1'
    implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.glideVersion}"
    implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
    implementation 'com.uber.autodispose:autodispose-lifecycle:1.3.0'
    implementation 'com.uber.autodispose:autodispose:1.3.0'
    implementation 'com.uber.autodispose:autodispose-android:1.3.0'
    implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
    implementation 'com.github.abdularis:ParallaxImageView:1.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1'
    implementation "com.github.miquelbeltran:conductor-viewmodel:1.0.3"
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.crystal:crystalrangeseekbar:1.1.3'
    implementation 'com.squareup.retrofit2:converter-scalars:2.0.1'
    implementation 'com.edmodo:rangebar:1.0.0'
    implementation 'jp.wasabeef:picasso-transformations:2.2.1'

    implementation 'com.apollographql.apollo:apollo-runtime:1.2.0-SNAPSHOT'
    compileOnly 'org.jetbrains:annotations:16.0.1'
    testCompileOnly 'org.jetbrains:annotations:16.0.1'

    implementation 'com.google.android.gms:play-services-wallet:18.0.0'

    implementation 'com.github.jkwiecien:EasyImage:3.0.3'

    implementation 'me.xdrop:fuzzywuzzy:1.2.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

@johan12345
Copy link
Contributor

com.androidadvance:topsnackbar depends on com.google.android.material:material:1.0.0 (see here), that might be the cause. But I don't have the time to check your whole Gradle configuration myself...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants