Chad Bingham
Chad Bingham

Reputation: 33856

Importing library in Android Studio

I have little experience with importing libraries. I am using Android Studio, and am trying to use parse.com's library with no luck. I followed these instructions, and tried a few other things when that didn't work. Please help me out. Let me know if you need any more information. Thanks for your time.

This is my MainActivity where I would initialize my Parse client key: MainActivity

Project Structure showing I have imported the libraries: Project Structure enter image description here

UPDATE Gradle: enter image description here UPDATE: When I try to Build, I get this error: Gradle: error: package com.parse does not exist When I try cleaning through command promptenter image description here

Upvotes: 0

Views: 6169

Answers (2)

SilleBille
SilleBille

Reputation: 639

To add to the answer of @ThePoloDoc and for your update Command Prompt image, you need to do the following to clear that error:

  1. Go to Control Panel -> System -> Right Side see for Advanced System settings
  2. Select Environmental Variables
  3. In the new window, search for the PATH variable. Add the java installation folder something similar to C:\PATH_TO_JDK\bin

Replace the PATH_TO_JDK with the installation of your java directory Try opening the command prompt and you'll see the error gone.

UPDATE: I have got a doubt in your question. Why do you manually compile gradle? I use Android Studio. But I always click the Sync Project with Gradle Files button on the top. It does everything for me

Upvotes: 0

ThePoloDoc
ThePoloDoc

Reputation: 340

  1. Put the jar into the libs folder
  2. Right click it and hit 'Add as library'
  3. Ensure that compile files('libs/~~~~~~~~.jar') is in your build.gradle file
  4. Do a clean build (You can do this easily in android studio but just as a better method, go to your project folder using windows explorer and open a Command window there by right clicking the folder while holding shift and type gradlew build.

Upvotes: 4

Related Questions