I am trying to connect my andoid app to dynamo db for CRUD operation when I click on any button it throws, "Unforutunately app stopped working" from my android device with following log at backend[log cat]
Process: com.connect.dynamodb.connecttodynamodb, PID: 16283 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.NoSuchFieldError: com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.endpointPrefix at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.init(AmazonDynamoDBClient.java:460) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.(AmazonDynamoDBClient.java:444) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.(AmazonDynamoDBClient.java:392) at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.(AmazonDynamoDBClient.java:361)
I created identity pool,account id,auth user and unauth user roles Configurations done are as follows for Cognito
Try 1 :
> CognitoCachingCredentialsProvider credentials = new
> CognitoCachingCredentialsProvider(context,
> "accountId",
> Constants.IDENTITY_POOL_ID,
> "Unauth_Role",
> "Auth_Role",
> Regions.US_EAST_1);
> ddb = new AmazonDynamoDBClient(credentials);
> ddb.setRegion(Region.getRegion(Regions.US_WEST_2));
Try 2:
CognitoCachingCredentialsProvider credentials = new CognitoCachingCredentialsProvider( context, "IDENTITY_POOL_ID", Regions.US_EAST_1); ddb = new AmazonDynamoDBClient(credentials); ddb.setRegion(Region.getRegion(Regions.US_WEST_2)); }
Both tries are not working .Any help would be appreciated.I am referring following link.