title: Amazon AWS Android- DynamoDBHashKey annotation found in class
body: <p>Trying to do a simple write operation onto my DynamoDB but looks like it is not as simple as I thought it would be. I seem to be stuck with this error and I am out of solutions. Help needed.</p>
  
  <p>I have the below code where I am trying to write data to AWS DynamoDB</p>
  
  <pre><code>import android.os.AsyncTask;
  import android.os.StrictMode;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;
  import com.amazonaws.ClientConfiguration;
  import com.amazonaws.auth.CognitoCachingCredentialsProvider;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBAttribute;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBIndexHashKey;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBIndexRangeKey;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBTable;
  import com.amazonaws.regions.Region;
  import com.amazonaws.regions.Regions;
  import com.amazonaws.services.dynamodbv2.*;
  
  import java.util.List;
  
  public class MainActivity extends AppCompatActivity {
  
      CognitoCachingCredentialsProvider credentialsProvider;
      TextView tv1;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          tv1=(TextView)findViewById(R.id.textView1);
          // Initialize the Amazon Cognito credentials provider
          credentialsProvider = new CognitoCachingCredentialsProvider(
                  getApplicationContext(),
                  "Identity Pool ID", // Identity Pool ID
                  Regions // Region
          );
  
          WriteToDBOperation wtd=new WriteToDBOperation();
          wtd.execute();
      }
  
      private class WriteToDBOperation extends AsyncTask&lt;String, Void, String&gt; {
  
          @Override
          protected String doInBackground(String... params) {
                  try {
                      //AmazonDynamoDBClient ddbClient = new AmazonDynamoDBClient(credentialsProvider);
  
                      AmazonDynamoDBClient ddbClient = Region.getRegion(Regions.AP_NORTHEAST_1) // CRUCIAL
                              .createClient(
                                      AmazonDynamoDBClient.class,
                                      credentialsProvider,
                                      new ClientConfiguration()
                              );
  
  
                      DynamoDBMapper mapper = new DynamoDBMapper(ddbClient);
  
  
                      SongRequest song = new SongRequest();
                      song.setSongID("Test1");
                      song.setSongName("TestSong");
                      mapper.save(book);
                  } catch (Exception e) {
                      Log.e("Error",e.toString());
                  }
              return "Done";
          }
          @Override
          protected void onPostExecute(String result) {
              tv1.setText("Working?");
          }
      }
  
  
      @DynamoDBTable(tableName = "test1")
      public class SongRequest {
          private String SongName;
          private String SongArtist;
          private String SongAlbum;
          private String SongID;
  
          @DynamoDBHashKey(attributeName = "id1")
          public void setSongID(String songid) {
              this.SongID = songid;
          }
  
          public String getSongID() {
              return SongID;
          }
  
          @DynamoDBAttribute(attributeName = "testt12")
          public String getSongName() {
              return SongName;
          }
  
          public void setSongName(String songname) {
              this.SongName = songname;
          }
      }
  }
  </code></pre>
  
  <p>I keep getting the below mentioned error and eventually the write operation does not happen.</p>
  
  <pre><code>02-07 16:26:30.308 22309-22309/? I/art: Late-enabling -Xcheck:jni
  02-07 16:26:30.577 22309-22309/amazonaws.amazonawstest D/CognitoCachingCredentialsProvider: Loading credentials from SharedPreferences
  02-07 16:26:30.577 22309-22309/amazonaws.amazonawstest D/CognitoCachingCredentialsProvider: No valid credentials found in SharedPreferences
  02-07 16:26:30.611 22309-22344/amazonaws.amazonawstest D/OpenGLRenderer: Render dirty regions requested: true
  02-07 16:26:30.618 22309-22309/amazonaws.amazonawstest D/Atlas: Validating map...
  02-07 16:26:30.621 22309-22343/amazonaws.amazonawstest E/Error: com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMappingException: No interface com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey annotation found in class class amazonaws.amazonawstest.MainActivity$SongRequest
  02-07 16:26:30.661 22309-22344/amazonaws.amazonawstest I/Adreno-EGL: &lt;qeglDrvAPI_eglInitialize:410&gt;: QUALCOMM Build: 10/28/14, c33033c, Ia6306ec328
  02-07 16:26:30.662 22309-22344/amazonaws.amazonawstest I/OpenGLRenderer: Initialized EGL, version 1.4
  02-07 16:26:30.683 22309-22344/amazonaws.amazonawstest D/OpenGLRenderer: Enabling debug mode 0
  </code></pre>
  
  <p>The solution that I have already done and does not work for me are in the below links</p>
  
  <p><a href="https://stackoverflow.com/questions/31556023/android-amazon-dynamodb-error-in-basic-action][1]">Android Amazon DynamoDb error in basic action</a></p>
  
  <p>Any other ideas anybody?</p>