Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash at setSupportActionBar after add Glide dependncies. #2781

Closed
dyguests opened this issue Jan 2, 2018 · 1 comment
Closed

Crash at setSupportActionBar after add Glide dependncies. #2781

dyguests opened this issue Jan 2, 2018 · 1 comment

Comments

@dyguests
Copy link

dyguests commented Jan 2, 2018

Glide Version:4.4.0

Integration libraries:RxJava/RxAndroid/RxKotlin,Retrofit,okhttp3-3.8.0,gson,jsoup.

Device/Android Version:Huawei 6X/Android 7.0

Issue details / Repro steps / Use case background:

Issue details:

I init a android project with kotlin.when I add Glide dependenies,it crash at setSupportActionBar(toolbar) in MainActivity.

Repro steps:
  1. without Glide denpendeies,run app,works good.
    2.add Glide dependenies,run app,crash.

Glide load line / GlideModule (if any) / list Adapter code (if any):

I'd even not use any code with Glide.

Something maybe helpful:

gradle-wrapper.properties:distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

root build.gradle:

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

app module build.gradle:

dependencies {
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    testImplementation 'junit:junit:4.12'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.android.support:appcompat-v7:$android_support_version"
    implementation "com.android.support:cardview-v7:$android_support_version"
    implementation "com.android.support:design:$android_support_version"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation "org.jetbrains.anko:anko-commons:$anko_version"
    implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
    implementation 'io.reactivex.rxjava2:rxkotlin:2.0.2'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation project(':net')
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
    implementation 'com.github.bumptech.glide:glide:4.4.0'//if I add this dependency,It will crash.
    annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'//if I add this dependency,It will crash.
    implementation 'org.jsoup:jsoup:1.10.2'
}

Layout XML:

I'd even not use any code with Glide.

Stack trace / LogCat:

01-02 11:29:07.420 11584-11584/com.fanhl.kona E/AndroidRuntime: FATAL EXCEPTION: main
                                                                Process: com.fanhl.kona, PID: 11584
                                                                java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics/Typeface; in class Landroid/support/v4/content/res/ResourcesCompat; or its super classes (declaration of 'android.support.v4.content.res.ResourcesCompat' appears in /data/app/com.fanhl.kona-2/split_lib_dependencies_apk.apk)
                                                                    at android.support.v7.widget.TintTypedArray.getFont(TintTypedArray.java:119)
                                                                    at android.support.v7.widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:208)
                                                                    at android.support.v7.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:110)
                                                                    at android.support.v7.widget.AppCompatTextHelperV17.loadFromAttributes(AppCompatTextHelperV17.java:38)
                                                                    at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:81)
                                                                    at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:71)
                                                                    at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:67)
                                                                    at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:753)
                                                                    at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261)
                                                                    at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243)
                                                                    at android.support.v7.app.ToolbarActionBar.<init>(ToolbarActionBar.java:74)
                                                                    at android.support.v7.app.AppCompatDelegateImplV9.setSupportActionBar(AppCompatDelegateImplV9.java:217)
                                                                    at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:129)
                                                                    at com.fanhl.kona.ui.main.MainActivity.onCreate(MainActivity.kt:20)
                                                                    at android.app.Activity.performCreate(Activity.java:6910)
                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
                                                                    at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:105)
                                                                    at android.os.Looper.loop(Looper.java:156)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6523)
                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

image
image

And,here is my code:
setSupportActionBar in MainActivity
dependencies for Glide

@sjudd
Copy link
Collaborator

sjudd commented Jan 2, 2018

Duplicate of #2730

@sjudd sjudd marked this as a duplicate of #2730 Jan 2, 2018
@sjudd sjudd closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants