Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

glenn romaniuk
glenn romaniuk
32,240 Points

Android studio code example - Updating the Main Layout - download code does not work

i'm new to android studio so i'm not sure how to fix

I downloaded the sample code when I load into android studio it displays the following message

"the path \users\benjakuben\development\antroid-sdk does not refer to an anroid sdk" it tells me it will use the default path c:\program files\android-studio\sdk

verified the path exists

if i build the project it displays the following error

unsupportedmethodexception - failed to set up android module sin project stormy: unsupported method: baseartifact.getjavacompiletaskname(). the versio nof gradle you connect to does not support that method. to resolve th eprblem you can change/upgrade the targe versio of gradle you connect to. alternatively, you can ignore this exception and read other information from the model.

How can i get this to run?

2 Answers

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Most likely that project was built using an older version of gradle than you currently have. Does this video (start at about 2:20) solve the problem?

glenn romaniuk
glenn romaniuk
32,240 Points

I only have the one version that i downloaded from the video download link. As in your scenario where you compare it to an earlier version I have only one version. Any ideas?

glenn romaniuk
glenn romaniuk
32,240 Points

here's the initial error i get when trying to sync the gradle

Error:A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.android.support:appcompat-v7:21.0.2. Searched in the following locations: https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.2/appcompat-v7-21.0.2.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.2/appcompat-v7-21.0.2.jar file:/C:/Program Files/android-studio/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.2/appcompat-v7-21.0.2.pom file:/C:/Program Files/android-studio/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.2/appcompat-v7-21.0.2.jar Required by: StormyLists:app:unspecified

Ben Deitch
Ben Deitch
Treehouse Teacher

Hmm, if you go into the SDK manager do you have both the Android Support Repository and Android Support Library installed?