Skip to content Skip to sidebar Skip to footer

How To Add Parse To An Android Studio Project?

I'm trying to use the Parse library in Android Studio. I have used the basic example on their website and added the jar to the libs folder as well as added as a global library. Not

Solution 1:

I encountered the same problem too and here's what I did:

  • I placed the entire Parse-1.2.5 in the libs folder (I didn't have to create the folder as Parse's quickstart said).
  • Open the build.grade file. There are two of them - open the one that's at the same level as the src folder
  • You'll see two instances of "dependencies". Add the following to the "dependencies" that is NOT nested under "buildscript":

    compile files('libs/Parse-1.2.5/Parse-1.2.5.jar')

If that still doesn't work, try right clicking the Parse-1.2.5.jar file and select "Add to Project Library"

Hope that helps!

Solution 2:

As of version 1.10.0 the Parse SDK is open source and available on Maven, so now you can just put this in gradle:

compile'com.parse:parse-android:1.10.0'

Just replace 1.10.0 with whatever the newest verison is at the time you read this.

Alternatively, if you like living on the edge, you can tell gradle to auto-update:

compile'com.parse:parse-android:1.+'

EDIT: On 1/28/16 Facebook announced that they are retiring the Parse service, so if you are starting a new project I would urge you to consider using a different service.

Solution 3:

The problem is that gradle doesnt do a proper rebuild and somehow still reads a cached version of the old build script. Add the libs as per above reply then open a terminal and do a gradle clean. If you are running on windows (or any platform for that matter) I suggest you do a quick internet search on "intellij clean" to see what it does and then simply do a manual clean by deleting the appropriate folder. This should do the trick!

edit: before manually deleting the appropriate folders/caches you can also first try clicking on file -> invalidate caches. If this still doesnt work manually delete all the appropriate folders and caches

Solution 4:

1) I unzip the folder into the libs folder:

YourProject/app/libs/Parse-1.9.2/ <<< here all the jar files.

2) and then in the dependencies section from your build.gradle, I set:

dependencies { 
    ...
    // Parse 1.9.2compile'com.parse.bolts:bolts-android:1.+'compile fileTree(dir: 'libs/Parse-1.9.2', include: 'Parse-*.jar')
    ...
}

I set the specific folder where the jars are contained dir: 'libs/Parse-1.9.2'

Hope it helps!

Solution 5:

In your app gradle add below code

dependencies {
    compile'com.parse.bolts:bolts-android:1.+'compile'com.parse:parse-android:1.+'
}

In AndroidManifest.xml file add below permission

<uses-permissionandroid:name="android.permission.INTERNET" /><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" />

In your Application class inside onCreate() method add below code

Parse.initialize(this, "application_id", "client_key");
ParseInstallation.getCurrentInstallation().saveInBackground();

then run. Hope this works, for more info https://parse.com/apps/quickstart#parse_data/mobile/android/native/existing

Post a Comment for "How To Add Parse To An Android Studio Project?"