w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I import library at android-studio?

Android Studio uses Gradle for building. Version 2.2 should pick up all libraries specified in build.gradle file. However, If you change anything in Project Structure dialog it won't update build.gradle file.

Open

-project_root
    -module_root
        build.gradle

This file should NOT be empty. There is another empty build.gradle in the project_root folder so do not confuse them. Add all libraries you need inside dependencies closure. Do not confuse dependencies closure with buildscript.dependencies.

apply plugin: 'android'

repositories {
    mavenCentral()
}

dependencies {
    compile files('libs/android-support-v4.jar')
    //here is depenency from Maven Central Repository
    compile 'org.roboguice:roboguice:2.0'
    //here is dependency from your local libs folder
    compile files('libs/mylib.jar')
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.