question

"smallik" avatar image
"smallik" asked

Running the Samples part of the SDK

I am trying to run the MainActivity sample within Android Studio and getting exceptions on all the Java files. All of them are related to Class R. Ex: One exception is R.layout.list_main is not a field. Another one is R.layout.activity_zbutton is not a field. Almost all the files did not have amazon.R package import statement. After Android Studio fixed it by adding the import statement all exceptions point to those kind of errors (not a field or can not find reference). Are the samples and released SDK in sync?
fire phone
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kevin@Amazon avatar image
Kevin@Amazon answered
Hi Smallik, The ‘MainActivity’ is actually a class within one of the 9 sample apps included within the FirePhone SDK download. To use the samples, you will first need to delete the samples you have imported thus far. Then open Android Studio, select ‘File’ > ‘Import Project’ and navigate to your downloaded/extracted Fire_Phone folder. Then select the ENTIRE Samples folder, then ‘OK’ to start the import. The Samples folder has several files that the Gradle build system needs for any of the sample apps to compile and run properly. For more information, please follow the instructions at: https://developer.amazon.com/public/solutions/devices/fire-phone/docs/viewing-sample-apps
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

farrabal avatar image
farrabal answered
This is related to the SDK samples as well. The documentation states: Viewing Samples Using Android Studio Open Android Studio. On the File menu, click Import Project. Select the /add-ons/addon-amazon_fire_phone_sdk_addon-amazon-17/samples directory. Click Ok to load all samples within the directory. Select a sample to run. Click Run. Done. But after importing it there's nothing I can Run, it imports some gradle settings and all I see is this: http://i.imgur.com/6fq4dhz.png http://i.imgur.com/4CndZpu.png http://i.imgur.com/DgB9EGV.png I'm using Android Studio 1.0.1. Thank you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

farrabal avatar image
farrabal answered
Issue is solved: It seems you guys don't have a working Amazon Gradle plugin compatible with Android Studio 1.0 ( at Dec/2014 ). Downgrading to Android Studio 0.8.10 did the trick.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.