作者:永恒多一天_313 | 来源:互联网 | 2023-02-06 17:59
我在Android Studio 2.3中工作,我想使用我在github上找到的库(https://github.com/henrychuangtw/Android-ChatHead)并且没有Jar文件.在settings.gradle中,我已经声明了库所在的目录,如下所示:
include ':app'
include ':Android-ChatHead'
project(':Android-ChatHead').projectDir=new File('/Users/lorand/AndroidStudioProjects/Doritest/android_chatHeads')
我还将库添加到build.gradle依赖项中:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':Android-ChatHead')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
在此之后,如果我同步,我会收到此错误:
Gradle sync失败:Project:app声明从配置'compile'到配置'default'的依赖关系,它未在项目描述符中声明:Android-ChatHead.有关更多详细信息,请参阅IDE日志(帮助|显示日志)
如果我将/ app添加到settings.gradle文件路径的末尾,则会出现以下错误:
Error:Dependency Doritest:Android-ChatHead:unspecified on project core resolves to an APK archive which is not supported as a compilation dependency.
File: /Users/lorand/AndroidStudioProjects/Doritest/android_chatHeads/Android-ChatHead/app/build/outputs/apk/Android-ChatHead-release-unsigned.apk
我无法弄清楚我应该做些什么.