question

Seth C. Short avatar image
Seth C. Short asked

"Unsupported version of the Android Gradle plug-in (0.11.2)"

Hi, I'm completely new to development for Fire, so I walked through the setup process to get Amazon's Fire Phone SDK working on Amazon Studio -- outlined here: https://developer.amazon.com/public/solutions/devices/fire-phone/docs/setup It seems the instructions are written for an earlier version of Android Studio, as the references to how to install the Add-In don't quite work, but I think I figured it all out. However, trying to set up a test project, I'm running into incompatibilities between Amazon's Gradle and the Android Studio... or something? Here are screen shots: https://drive.google.com/file/d/0B4ywYG2ItD3hZ3V3RjdYeXJDOUU https://drive.google.com/file/d/0B4ywYG2ItD3hNm9kN1pDZEx6NlE Note: While Amazon's instructions refer to stuff in the project's build.gradle file that isn't in there... and there's a comment in there saying not to put it in there. So I put it in the "app"'s build.gradle file. See screenshots. I'm totally confused. I've tried a few things and it's still giving me the Gradle version error. Help! Seth
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 Seth, Let's take a close look at your Android SDK Manager and how you have installed the Fire Phone SDK Add-on. I have attached a screen shot of exactly what you should see for Android 4.2.2 (API17). Can you confirm this is exactly what you see?
10 |5000

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

videva avatar image
videva answered
Also consider restarting Studio and cleaning the project after installing updates. Studio is a bit buggy.
10 |5000

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

andypondy avatar image
andypondy answered
Hi Seth, Have you found a solution to this? I get this same message even for the damn samples provided by amazon
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
A few tips as others are having this issue as well. 1- The issue here is a mismatch between the Gradle plugin version and the dependency (class path). 2- Check that you are using the latest stable Android Studio build: v0.8.0 https://developer.android.com/sdk/installing/studio.html 3- Choose the Canary channel and upgrade to the latest version. To do this, in Android Studio go to ‘Help’ > ‘Check for Update’ and you should see the latest version update – currently v0.8.1 4- In the build.gradle file for your project, in the classpath, replace android with amazon.device as shown in the following example: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' } } We have updated our documentation, you can reference this here: https://developer.amazon.com/public/solutions/devices/fire-phone/docs/setup
10 |5000

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

Seth C. Short avatar image
Seth C. Short answered
Great! Gradle now checks out (changed to v0.12.+) However, I'm given this error: Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. This is a new test project with a blank activity, I haven't added or changed anything from the default. As for the installed SDK assets, I went with exactly what the instructions suggested. Under API17, I chose SDK Platform, Fire Phone, and Fire TV. None of the others. Has this changed? Should I install ARM, Intel, and MIPS images? Google APIs and Sources? Seth
10 |5000

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

Seth C. Short avatar image
Seth C. Short answered
Note, if you've updated the documentation on that page, it's still not correctly conforming to Android Studio 0.8.1. This part: " A full build.gradle file might look like this : buildscript { repositories { mavenCentral() } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' } } apply plugin: 'android' android { compileSdkVersion " Amazon.com:Amazon Fire Phone SDK Addon:17" buildToolsVersion "19.1.0" defaultConfig { minSdkVersion 17 targetSdkVersion 17 } } " ... is not correct. The entire lower half of that code (starting with "apply plugin") resides in a different build.gradle file within the app folder. There's definite instructions in the project's build.gradle file to NOT put any dependencies in that file. Here's what mine looks like right now: " buildscript { repositories { mavenCentral() } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenCentral() } } " ... and in the individual app's build.gradle file, it looks like this: " apply plugin: 'android' android { compileSdkVersion " Amazon.com:Amazon Fire Phone SDK Addon:17" buildToolsVersion "19.1.0" defaultConfig { applicationId "com.sethcshort.www.firephonetest" minSdkVersion 17 targetSdkVersion 17 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile(' proguard-android.txt'), ' proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } " .... NOTE, I also had to change the "apply plugin:" from its default value, which was "com.android.application". When I changed it to your suggested value, "android", I'm getting a highlighted line that tells me that it's been deprecated. Seth Message was edited by: Seth C. Short
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 Seth, This is more of an issue with how we have chosen to package the Sample apps and, admittedly, our documentation could be clearer – we will work on that. In the projects build.gradle file you are correct you want something like: } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } In the various modules you see another build.gradle file as well (as they are all apk’s) with something like: } apply plugin: 'android' android { compileSdkVersion " Amazon.com:Amazon Fire Phone SDK Addon:17" buildToolsVersion "19.1.0" defaultConfig { minSdkVersion 17 targetSdkVersion 17 } } However, we could have also made just one build.gradle file, [u]in each module[/u] (SidePannels, HeadTracking, etc.) that put everything into one file as in the example in our doc: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' } } apply plugin: 'android' android { compileSdkVersion " Amazon.com:Amazon Fire Phone SDK Addon:17" buildToolsVersion "19.1.0" defaultConfig { minSdkVersion 17 targetSdkVersion 17 } } Note that you will want to use the classpath 'com.amazon.device.tools.build:gradle:0.12.+' as it contains all the com.android build as well as the required Fire Phone dependencies.
10 |5000

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

aloymatrix avatar image
aloymatrix answered
Hi there I'm sitting with the same issue. can you please assist. I've been sitting for hours and still don't get this to work. I want to be able to develop for most older and the latest Amazon devices and also use Amazon Adds. Can you please provide a fully build sample app we could "copy" this might be the best option. I am using Android Studio v 0.8.9 and I don't see the maven Central, Mine shows jcenter. I firstly need clarification on this. My build.gradle under Gradle folder looks like this: buildscript { repositories { jcentral() } dependencies { classpath 'com.amazon.device.tools.build:gradle:0.12.+' } } all projects { repositories { jcenter () } } I need to know what exactly I need to add or remove or if this is 100% correct? Then in my gradle.build file in my Main folder, this is what it looks like and I need to know what exactly it should say to work and to build for the latest and most Kindle devices: apply plugin: 'com.mywebsite.applicationname' android { compileSdkVersion " Amazon.com:Amazon Fire Phone SDK Addon:17" buildToolsVersion "20.0.0" defaultConfig { applicationId "com.mywebsitename.applicationname" minSdkVersion 17 targetSdkVersion 20 versionCode 1 VersionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile(' proguard-android.txt'), ' proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: [*jar']) } This should be fairly simple but I cannot figure out how to make this work. I also need to learn to setup adds and I'm worrying if this is so hard and I have not even begun with the project itself. Can I ask you to assist me please? Anyone else who figured this out, please help me get this right. Kind Regards Al
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 Al, Note that unless you are trying to implement API’s specific to the Firephone there is no need to use Android Studio, you can stick with Eclipse. Also, unless you have an actual device you will only be able to simulate side panels and hero widgets with the included API Simulator tool. If you are trying to integrate the Firephone SDK for an app targeted to the Firephone, then you need to follow the instructions closely: https://developer.amazon.com/public/solutions/devices/fire-phone/docs/setup The previous post has the suggested build.gradle file templates, you should note that you have several errors, such as targetSdkVersion 20 for example. Also, included in the SDK download are several sample apps that should get you started.
10 |5000

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