gpt4 book ai didi

java - 如何手动添加依赖到Android Studio

转载 作者:太空狗 更新时间:2023-10-29 16:00:12 26 4
gpt4 key购买 nike

我多次尝试向我的项目添加依赖项,但每次都报错我想添加它们的依赖项是 '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'
}

最佳答案

下载你想要的库的jar/aar文件

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

 compile files('libs/library.jar')

对于 *.aar 文件:尝试从项目结构/新模块/从 aar/jar 导入

祝你好运

关于java - 如何手动添加依赖到Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37721844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com