1

I had to re-install Android Studio 2.1.3 and now i have some errors. Some of my imports are missing e.g.

 android.os.Handler;
 google.gson.Gson;
 android.util.Log;

How do install these libraries? I tried File=>project Structure=>app=>depenencies and did a search for google.gson.Gson was there but studio is not loading it. The other libraries were not listed in dependencies. Where can I load those.

Paul Stanley
  • 1,999
  • 1
  • 22
  • 60

2 Answers2

1

You don't need to add android.os.Handler and android.util.Log in your dependencies.if you have allready add Gson api as

compile 'com.google.code.gson:gson:2.2.4'

just build your project the classes will be automatically import,if not then go to your source code and line which are shown in red hit alt+enter and import classes.

  • 1
    Unfortunately that is not working import android.util.Log; is still red -as is the reset. Is there a way to rest the project and import these libraries? – Paul Stanley Aug 24 '16 at 06:39
  • would u plz check sdk path at Tool>>Android>>SDK Manager and at path specify in ur project at File>>Project Structure>>Sdk Path,both are must be same if not then set your sdk path as SDK Manager path at File>>Project Structure>>Sdk – vikash kumar tiwari Aug 25 '16 at 15:43
0

Make sure your using Android Studio as admin otherwise upating gradle will fail. This answer helped me.

  http://stackoverflow.com/questions/18555135/the-best-way-to-integrate-third-              party-   library-in-android-studio
Paul Stanley
  • 1,999
  • 1
  • 22
  • 60