Search code examples
androidandroid-studio-3.1calligraphy

Cannot resolve symbol 'CalligraphyContextWrapper'


Till yesterday everything was working fine but today i have updated my Android studio from 2.3 to 3.1 and i am getting this error now. But even i am getting Cannot resolve symbol CalligraphyContextWrapper, still project is successfully clean and build and the font is changing fine. I am surprised if everything is working fine then why this error appears. You can see the error in image and also i am adding my gradle code below. Please let me know if i am doing something wrong.

enter image description here

build.grade:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.package"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation  'com.android.support:appcompat-v7:27.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:design:27.0.0'
    implementation 'com.android.support:cardview-v7:27.0.0'
    /* Retrofit */
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.squareup.okhttp3:okhttp:3.4.2'
    //multi dex
    implementation 'com.android.support:multidex:1.0.1'
    //Picasso
    implementation 'com.squareup.picasso:picasso:2.5.2'
    //Buimplementationtter knife
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    //planet payment gateway
    implementation 'com.google.android.gms:play-services-wallet:11.0.4'
    //font
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'io.card:android-sdk:5.5.1'
}

I have also raised the issue in github but there is no response from Calligraphy team. https://github.com/chrisjenx/Calligraphy/issues/449#issuecomment-386390551

Any help or clue will be appreciated.


Solution

  • You can Downgrade version. Use 2.2.0 instead of 2.3.0.

    implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
    

    Then Clean-Rebuild-Run.