首页 > 解决方案 > 错误 java.lang.NoSuchMethodError - 外部库

问题描述

嗨,我正在尝试使用一些外部库,事情是它们在编译时被检测到

在此处输入图像描述

因为我可以去参考 在此处输入图像描述

但是当我尝试运行它时,我收到以下错误

在此处输入图像描述

对我来说奇怪的是,包含该方法的文件没有出现在我的外部文件中当我在文件中搜索它时,它应该在此处显示为 rememberLottieComposition.kt 但只出现在 RememberLottieCompositionKT.class

在此处输入图像描述

顺便说一句,当我查看我的文件时,存在包含缺失方法的文件

在此处输入图像描述

所以不知道如何解决它,我尝试了很多但没有结果。

任何关于它可能是什么的想法都会有帮助!

先感谢您

这是我的构建 gradle:App

plugins {
id 'com.android.application'
id 'kotlin-android'

}

android { compileSdkVersion 30 buildToolsVersion "29.0.2"

defaultConfig {
    applicationId "com.example.perri"
    minSdkVersion 23
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
    //de 1.5.1
}

}

//compose_version = '1.0.0-beta01' 依赖{

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"



//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0' // appcompat library
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'


implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.1.0'

implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'



implementation "com.airbnb.android:lottie:4.0.0"

implementation "com.airbnb.android:lottie-compose:4.0.0"
implementation "androidx.compose.runtime:runtime:1.0.0-beta01"



implementation 'androidx.recyclerview:recyclerview:1.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:25.3.1'


//swipe
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.2.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.compose:compose-runtime:0.1.0-dev10'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'


implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

}

这是另一个构建 Gradle 在此处输入图像描述

标签: javakotlingradlelibrariesnosuchmethoderror

解决方案


推荐阅读