Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (retired 2014) Learning the Language Introduction to Arrays

android development environment

Setting up the development environment is actually harder than coding in java. When i import the project to eclipse i get tons of error. I had no choice but start from scratch . Then i decided i should try android studio which made things even worse. Right after creating a new project i get a gradle sync issue which i couldnt solve. I also cannot instantiate a textview object by calling the findbyview method. R.id.textviewname doesnt work.

14 Answers

Alessandro Calorì
Alessandro Calorì
10,241 Points

Can you please elaborate on what is your exact problem?

sorry i thought it was clear enough. Right after launching the android studio, i get an error saying that gradle sync failed. i tried every recommended solution but no dice. If i ignore the error and continue my project i get other errors too. I tried installing the AS on a windows machine and have had no problems so far.

Alessandro Calorì
Alessandro Calorì
10,241 Points

Uhm, ok. So you're using something else than Windows? MacOS X? Linux?

I am on a mac running os x maverics .

Alessandro Calorì
Alessandro Calorì
10,241 Points

Keep in mind that IntelliJ IDEA and Android Studio store library's directory reference in their configuration so it is possible that you are try to refer Windows paths on MacOS X. Try to delete IDEA configuration file (*.iml) and directory (.idea) and import the code into a new project. Also take a look at the project settings (CTRL + ALT + S on Windows) at the SDK directories for Java and Android.

Sorry dont follow. I dont have any prior intellij idea installation. I am starting from scratch anyway. Install android studio create new project and get this error.

I believe i might have failed to elaborate the issue clearly. Forget about importing problem. That happens on eclipse. Android studio is what i would like to use but cant.

Alessandro Calorì
Alessandro Calorì
10,241 Points

Ok, if you want to import an Eclipse ADT project in Android Studio there is a rather clear guide on Android Developer.

BUT, before that you have to configure Android Studio correctly installing tha Java Development Kit and Android SDK. Did you do that?

Thats what my problem is. I could install JDK and the SDK but i am receiving an error about gradle sync.

Alessandro Calorì
Alessandro Calorì
10,241 Points

What does Android Studio displays in the "Message" toolbox? Does it give some specific error or just a "Gradle Sync Failed"? It's too generic and usually it means that it cannot find either the Java Dev Kit or the Android SDK. It can be also related to installation issues: did you installed the Support Library AND the Support Repository from the Android SDK Manager?

The message toolbox says unable to open zip file. thats all . I installed the support library and repository from the SDK manager

Alessandro Calorì
Alessandro Calorì
10,241 Points

Ok. Try with these steps:

  1. Invalidate IDE cache (File->Invalidate cache) and close Android Studio
  2. Delete .gradle (watch the leading dot) folder from your project
  3. Try again to open the project and rebuild

Already did that. However i cant find the .gradie folder.

Alessandro Calorì
Alessandro Calorì
10,241 Points

Can you take a look at your Gradle setting? It should look like this:

gradle settings