Adding Parse-1.8.0 to Android Studio 1.0.1 (or any .zip file)

So, it seems that there are several threads that are trying to explain how to add .zip files to Android studio, but I am not moving forward. I am moving from eclipse, which is probably why I am so incompetent in figuring out how to complete this task. Can someone explain how to add external libraries in Android Studio v1.0.1? In eclipse, he simply imported jar / zip and did.

+4
source share
3 answers

I was in the same situation trying to integrate Parse 1.8 with Android Studio 1.0.2.

On the Parse instructions page, he simply asks you to import the library into Android studio, which is not too detailed. This is how I solved this problem.

  • Select to import from the "Non Android Studio Project" immediately after launching Android Studio.
  • When it asks you to select a project, specify the path in Windows, for example, C: / path / to / parsesdk /. On * nix systems, this should be where you extracted it, / home / user / path / to / parsesdk.
  • After choosing the path, Android Studio will import the project accordingly.
  • Click the root folder of the application (in the upper folder in the folder hierarchy on the left), right-click> New> Package> and add it to the src folder, the name is libs.
  • Copy the jar bundle to the libs folder (I just copied the jar file since I do not need other additional material)
  • , , " " , .

Android Studio build.gradle.

compile files('src/libs/Parse-1.8.0.jar')
  1. , "" > " ". "", "" .
  2. "+" > " "
  3. .

, build.gradle "ParseStarterProject", ,

 dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'
}

.

, :)

+4

gradle - ( ), snipet build.gradle.

buildscript {
    repositories {
       flatDir { dirs 'c:\\path\\to\\folder' }
       mavenCentral()
    }
}

, .

dependencies {
    compile fileTree(dir: 'a-folder-in-root-of-project', include: 'a_jar.jar')
}
0

This is the only way for me:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    //Parse
    compile 'com.parse.bolts:bolts-android:1.+'
    compile files('libs/Parse-1.9.2/Parse-1.9.2.jar')
    compile files('libs/Parse-1.9.2/ParseCrashReporting-1.9.2.jar')
    compile files('libs/Parse-1.9.2/ParseFacebookUtilsV3-1.9.2.jar')
    compile files('libs/Parse-1.9.2/ParseFacebookUtilsV4-1.9.2.jar')
    compile files('libs/Parse-1.9.2/bolts-android-1.2.0-javadoc.jar')
    compile files('libs/Parse-1.9.2/bolts-android-1.2.0.jar')
}

OR

//Parse
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs/Parse-1.9.2', include: 'Parse-*.jar')
compile fileTree(dir: 'libs/Parse-1.9.2', include: 'ParseCrashReporting-*.jar')
0
source

Source: https://habr.com/ru/post/1569924/


All Articles