当前位置: 首页 > 面试题库 >

java.lang.NoSuchMethodError:类中没有静态方法CombineMeasuredStates(II)I

谷梁卓
2023-03-14
问题内容

我有一个问题,我不确定为什么,仍然是新手,请帮助解决。

错误:java.lang.NoSuchMethodError:类Landroid / support / v7 / widget /
ViewUtils中没有静态方法CombineMeasuredStates(II)I;或其超级类(“
android.support.v7.widget.ViewUtils”的声明显示在/data/app/com.example.marvin.test-1/split_lib_dependencies_apk.apk:classes58.dex中)

建立gradle:

     apply plugin: 'com.android.application'

android {
useLibrary 'org.apache.http.legacy'

compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
    applicationId "com.example.marvin.test"
    minSdkVersion 16
    targetSdkVersion 27
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:exifinterface:25.3.1'
}



apply plugin: 'com.google.gms.google-services'

问题答案:

使用相同版本的依赖项

compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:exifinterface:27.0.1'


 类似资料:
  • 我正在构建一个Android应用程序,在尝试读取XLSX文件时,面临一个非静态方法异常。 尝试了所有的可能性,如更新应用程序/build.gradle中的依赖关系,但没有成功。 请帮助我解决此问题。 我正在添加app.gradle文件。其他代码是使用XSSF的基本XLSX文件读取。当我试图在Spring Suite工具中运行这个java片段时,它运行正常。然而,当我将这些java片段集成到Andr

  • 我正在尝试从下面的git链接运行代码 但我有个错误 nosuchMethodError:没有静态方法getFont(landroid/content/context;ilandroid/util/typedvalue;ilandroid/widget/textview;)landroid/graphics/typeface;在Landroid/Support/V4/Content/Res/Reso

  • 我有一个问题,我不知道为什么,还是个新手,请帮忙。 错误:java.lang.NoSuch方法错误:没有静态方法组合测量状态(II)我在类Landroid/support/v7/小部件/ViewUtils;或其超级类(声明android.support.v7.widget.ViewUtils出现在 /data/app/com.example.marvin.test-1/split_lib_depe

  • 我有一个扩展方法: 应用程序安装时没有任何错误;但是当在运行时调用该方法时,它会给我以下错误: java.lang.NoSuch方法错误:没有静态方法onClickButtonBack(Lcom/app/common_client/ui/片段 /stores/StoresClientFragment;)V类Lcom/app/common_client/公共资源/公共资源AppTypeGroupKt

  • 我试图在Android Studio中运行一个测试,测试设置抛出一个java.lang.NoSuchMethodError 测试: 有人知道正在发生什么,或者能给我指路? 编辑:当我在其他测试中创建一个实体的新实例时再次出现此错误,该实体在测试中是静态属性。