直到昨天一切正常,但今天我已将我的Android studio
从 2.3更新为3.1 ,我现在收到此错误。但即使我收到Cannot resolve symbol CalligraphyContextWrapper
,仍然项目成功clean
和build
,font
正在变好。如果一切正常,那么我很惊讶,为什么会出现这个错误。您可以在图片中看到错误,我也在下面添加 gradle 代码。如果我做错了,请告诉我。
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'
}
我也在github提出了这个问题,但书法团队没有回复。 https://github.com/chrisjenx/Calligraphy/issues/449#issuecomment-386390551
任何帮助或线索将不胜感激。
答案 0 :(得分:3)
您可以降级版本。使用2.2.0
代替2.3.0
。
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
然后 Clean-Rebuild-Run
。
答案 1 :(得分:1)
我不确定是否相关,但是我通过执行以下操作解决了类似的问题;