I am trying to follow a tutorial for DynamoDB on AWS website : http://aws.amazon.com/articles/7439603059327617 I downloaded the file, imported it to Eclipse, imported all the necessary libraries (or literally, all the libraries that came with the github file), but DynamoDBManager.java would keep giving me the dreaded "The import com.amazon... cannot be resolved" error for the following lines:
import com.amazonaws.services.dynamodbv2.model.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.model.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.model.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.model.DynamoDBScanExpression;
import com.amazonaws.services.dynamodbv2.model.DynamoDBTable;
import com.amazonaws.services.dynamodbv2.model.PaginatedScanList;
But library is imported for all other classes such as
import com.amazonaws.services.dynamodbv2.model.AttributeDefinition;
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest;
import com.amazonaws.services.dynamodbv2.model.DescribeTableRequest;
import com.amazonaws.services.dynamodbv2.model.DescribeTableResult;
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
import com.amazonaws.services.dynamodbv2.model.KeyType;
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException;
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType;
Did anyone else run into a similar problem? Could you please direct me in a right direction?!
Thank you in advance & for reading!
Dynamo DB made many breaking changes (requires code change) when they moved to DynamoDB V2.
You need to ensure that the latest SDK is installed and you re using it - In eclipse, you need to also mention which AWS SDK to use (point it to the latest). Though eclipse AWS plugin downloads the latest SDK automatically, it doesnt update the version number to us the latest. You need to update this yourself.
I am not 100% sure, but after digging the documentation, it seems like the classes that cannot be resolved are deprecated and are no longer included in the jar files... They do still exist in the source code folder, but seeing that since they are deprecared, I guess there is no use trying to follow the tutorial...
It is written in AWS Documentation what to do:
Existing Application The samples included with the AWS SDK for Android are provided as standalone projects set up for you to try out. To use AWS with an existing application, follow these steps:
- Create a libs directory within your Android project directory if one does not already exist.
- Copy either a bundled JAR for all services or the specific JARs for the services you wish to use.You have 3 options: Add aws-android-sdk-VERSION-debug.jar. This JAR creates the largest APK, but allows for full stack traces during development. Add aws-android-sdk-VERSION.jar. This JAR creates a smaller APK and a simple bundle when releasing your application. Add the aws-android-sdk-VERSION-core.jar plus the JARs for the individual services your project will use. This method creates the smallest APK, but requires a more complicated setup. Note, copying both bundled JARs and service JARs will cause errors.
- In Eclipse, go to your project, select Properties -> Java Build Path -> Libraries and click Add JARs. Then select the JARs you added to your libs directory.
I am trying to follow a tutorial for DynamoDB on AWS website : http://aws.amazon.com/articles/7439603059327617 I downloaded the file, imported it to Eclipse, imported all the necessary libraries (or literally, all the libraries that came with the github file), but DynamoDBManager.java would keep giving me the dreaded "The import com.amazon... cannot be resolved" error for the following lines:
import com.amazonaws.services.dynamodbv2.model.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.model.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.model.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.model.DynamoDBScanExpression;
import com.amazonaws.services.dynamodbv2.model.DynamoDBTable;
import com.amazonaws.services.dynamodbv2.model.PaginatedScanList;
But library is imported for all other classes such as
import com.amazonaws.services.dynamodbv2.model.AttributeDefinition;
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest;
import com.amazonaws.services.dynamodbv2.model.DescribeTableRequest;
import com.amazonaws.services.dynamodbv2.model.DescribeTableResult;
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
import com.amazonaws.services.dynamodbv2.model.KeyType;
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException;
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType;
Did anyone else run into a similar problem? Could you please direct me in a right direction?!
Thank you in advance & for reading!
Dynamo DB made many breaking changes (requires code change) when they moved to DynamoDB V2.
You need to ensure that the latest SDK is installed and you re using it - In eclipse, you need to also mention which AWS SDK to use (point it to the latest). Though eclipse AWS plugin downloads the latest SDK automatically, it doesnt update the version number to us the latest. You need to update this yourself.
I am not 100% sure, but after digging the documentation, it seems like the classes that cannot be resolved are deprecated and are no longer included in the jar files... They do still exist in the source code folder, but seeing that since they are deprecared, I guess there is no use trying to follow the tutorial...
It is written in AWS Documentation what to do:
Existing Application The samples included with the AWS SDK for Android are provided as standalone projects set up for you to try out. To use AWS with an existing application, follow these steps:
- Create a libs directory within your Android project directory if one does not already exist.
- Copy either a bundled JAR for all services or the specific JARs for the services you wish to use.You have 3 options: Add aws-android-sdk-VERSION-debug.jar. This JAR creates the largest APK, but allows for full stack traces during development. Add aws-android-sdk-VERSION.jar. This JAR creates a smaller APK and a simple bundle when releasing your application. Add the aws-android-sdk-VERSION-core.jar plus the JARs for the individual services your project will use. This method creates the smallest APK, but requires a more complicated setup. Note, copying both bundled JARs and service JARs will cause errors.
- In Eclipse, go to your project, select Properties -> Java Build Path -> Libraries and click Add JARs. Then select the JARs you added to your libs directory.
0 commentaires:
Enregistrer un commentaire