1

I am trying to create AmazonSNSClient and trying to list the platform application list as below.

AWSCredentials creds = new BasicAWSCredentials("XXXX", "XXXX");
try {
    AmazonSNS snsClient = AmazonSNSClient
                        .builder()
                        .withRegion(Regions.US_EAST_2)
                        .withCredentials(new AWSStaticCredentialsProvider(creds))
                        .build();

   ListPlatformApplicationsResult listResult = snsClient.listPlatformApplications(new ListPlatformApplicationsRequest());
   Log.d(TAG, "ADM : Platform Applications : " + listResult.toString());
}
catch(Exception err) {
    Log.d(TAG, "ADM : caught Exception while creating SNS client : " + err.toString());
}

I am able to create AWSCredentials and I am able to print the credentials I passed to BasicAWSCredentials. But Application is crashing when trying to create AmazonSNSClient and it is not even reaching catch block. I am using aws-java-sdk-1.11.646.jar. Can anyone please help me if there is anything wrong in the code or how to fix this issue.

kadina
  • 5,042
  • 4
  • 42
  • 83

0 Answers0