如何手动将依赖项添加到Android Studio

afz*_*ali 3 java android dependency-injection github android-studio

我尝试了几次将依赖项添加到我的项目,并且每次给错误添加要添加它们的依赖项, 'de.hdodenhof:circleimageview:1.3.0'并且'com.github.bumptech.glide:glide:3.6.1' 所以我想下载这些,并添加到我的项目是手动有可能,如果是如何?

这是我的应用程序 build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.0 rc4'

    defaultConfig {
        applicationId "ir.esfandune.material"
        minSdkVersion 23
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    packagingOptions {
        exclude 'classes.dex'
    }
}

repositories {
    jcenter()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

}

dependencies {
    compile 'com.android.support:design:23.0.0'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
    compile project(':material-dialogs')
    compile files('lib/de.hdodenhof/circleimageview/1.3.0/jars/classes.jar')
    //*** added from orginal source
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
}
Run Code Online (Sandbox Code Playgroud)

afz*_*ali 5

下载所需库的jar / aar文件

将文件复制到* .jar文件的应用文件夹中的libs目录中:将此代码添加到对gradle文件的依赖中

 compile files('libs/library.jar')
Run Code Online (Sandbox Code Playgroud)

对于* .aar文件:尝试从projectstructure /新模块/从aar / jar导入

祝好运