AWS Android initialization error | how to initialize

Viewed 89

Getting error when trying to update version https://search.maven.org/artifact/com.amazonaws/aws-android-sdk-auth-userpools

val initializeBuilder = AWSMobileClient.getInstance().initialize(activity) {
        createAwsSessionComponent(environment, configuration)
        doAfter.run()
    }
    initializeBuilder.awsConfiguration(configuration)
    initializeBuilder.execute()

getting error

Type mismatch. Required: Callback<UserStateDetails!>! Found: () → Unit

I am currently getting this error while logging analytics was able to log all other events but a specific event when popup box is display i am getting this issue.

AbstractKinesisRecorder: DeadLetterListener onRecordsDropped has thrown an exception (user code)
java.lang.NullPointerException: Attempt to invoke interface method 'void com.amazonaws.mobileconnectors.kinesis.kinesisrecorder.DeadLetterListener.onRecordsDropped(java.lang.String, java.util.List)' on a null object reference



AbstractKinesisRecorder: ServiceException in submit all, the last request is presumed to be the cause and will be dropped
com.amazonaws.AmazonServiceException: User:
1 Answers

To create a Native Android Mobile app that can invoke AWS Services, try using the AWS SDK for Kotlin. You can find information on how to get up and running with this SDK here:

Setting up the AWS SDK for Kotlin

This SDK works nicely with Android Studio to build Android Apps. It exposes a strongly typed Service Client you can use within an Android Studio project. For example, to invoke SNS, you can use SnsClient:

fun getClient() : SnsClient{

        val staticCredentials = StaticCredentialsProvider {
            accessKeyId = "<Enter key>"
            secretAccessKey = "<Enter key>"
        }

        val snsClient = SnsClient{
            region = "us-west-2"
            credentialsProvider = staticCredentials
        }

        return snsClient
    }

Link in the comment below.

Related