Reputation: 11
I am trying to integrate amplify into my android application. i have followed the setup procedures beforehand:
try {
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSPredictionsPlugin())
Amplify.configure(applicationContext)
Log.i("MyAmplifyApp", "Initialized Amplify")
} catch (error: AmplifyException) {
Log.e("MyAmplifyApp", "Could not initialize Amplify", error)
}
I get this error:
java.lang.NoSuchMethodError: No static method AuthOption-Jh0Pmzk$default(Ljava/lang/String;Laws/smithy/kotlin/runtime/util/Attributes;ILjava/lang/Object;)Laws/smithy/kotlin/runtime/auth/AuthOption; in class Laws/smithy/kotlin/runtime/auth/AuthOptionKt; or its super classes (declaration of 'aws.smithy.kotlin.runtime.auth.AuthOptionKt' appears in /data/app/~~rDNGSxK_wBHLaFeI6UIjdw==/com.singhealth.enhance-_AVqqONMQSfk2M5hb3fAdQ==/base.apk!classes10.dex)
i have tried invalidating android studio cache, reimporting modules, use the lastest module version.
Upvotes: 0
Views: 74
Reputation: 31
It might stem from problems within Android Studio's build cache or inconsistencies among dependency versions. Here are some troubleshooting steps to resolve it:
implementation("com.amplifyframework:aws-auth-cognito:2.14.10")
implementation("com.amplifyframework:aws-api:2.14.10")
implementation("com.amplifyframework:aws-predictions:2.14.10")
Doing this resolved the issue for me.
Upvotes: 0