应用程序崩溃,但代码中没有错误

我正在进入错误日志,并在该应用程序崩溃后。我的Java代码中没有任何错误。我不确定哪个库导致了这个问题。非常感谢您的帮助。java.lang.NoSuchMethodError


我已经将几个库更新到28和27,但仍然得到相同的错误。


错误


java.lang.NoSuchMethodError: No static method getScreenWidthDp(Landroid/content/res/Resources;)I in class Landroid/support/v4/content/res/ConfigurationHelper; or its super classes (declaration of 'android.support.v4.content.res.ConfigurationHelper' appears in /data/app/com

build.gradle


apply plugin: 'com.android.application'


android {

compileSdkVersion 28

defaultConfig {

    applicationId "com.test.test"

    minSdkVersion 15

    targetSdkVersion 28

    versionCode 1

    versionName "1.0"

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

    release {

        minifyEnabled false

        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

    }

}

}


dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])

//noinspection GradleCompatible

implementation 'com.android.support:appcompat-v7:27.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

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'


implementation 'com.android.support:cardview-v7:28.0.0'

implementation 'com.android.support:cardview-v7:28.0.0'

implementation 'com.rengwuxian.materialedittext:library:2.1.4'

implementation 'com.szagurskii:patternedtextwatcher:0.5.0'

implementation 'com.github.d-max:spots-dialog:1.1@aar'

implementation 'com.squareup.retrofit2:retrofit:2.3.0'

implementation 'com.squareup.retrofit2:converter-gson:2.3.0'


implementation 'com.facebook.android:account-kit-sdk:4.+'


}



慕森卡
浏览 117回答 2
2回答

胡说叔叔

如果没有完整的堆栈跟踪,则无法判断错误的来源。在您的构建文件中,唯一看起来可疑的是您没有通用的Android支持版本。您可以使用 和 的库。27.0.028.0.0

千巷猫影

添加实现“com.android.support:design:28.0.0”后,此问题得到了解决。谢谢大家的评论。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java