Android 将github库添加为不起作用的依赖项
我正在尝试使用此自定义列表视图 这里的步骤是: 步骤2。将特定存储库添加到生成文件:Android 将github库添加为不起作用的依赖项,android,gradle,dependencies,Android,Gradle,Dependencies,我正在尝试使用此自定义列表视图 这里的步骤是: 步骤2。将特定存储库添加到生成文件: repositories { maven { url "https://jitpack.io" } } 步骤3。在生成文件中添加依赖项(不要忘记指定正确的限定符,通常为“aar”): 以及来自desctiption的指示 “2.在活动或片段中实现WaterDropListView.IWaterDropListViewListener。” 所以我做到了: 在项目的bulid.g
repositories {
maven {
url "https://jitpack.io"
}
}
步骤3。在生成文件中添加依赖项(不要忘记指定正确的限定符,通常为“aar”):
以及来自desctiption的指示
“2.在活动或片段中实现WaterDropListView.IWaterDropListViewListener。”
所以我做到了:
在项目的bulid.gradle中:
在bulid.gradle模块中
渐变同步时没有错误。
但是当implementin inmain活动实现WaterDropListView.IWaterDropListViewListener时
我得到“无法解析符号WaterDropListView”这看起来不是有效的库 在it参考范围内
apply plugin: 'com.android.application'
图书馆应该是
apply plugin: 'com.android.library'
如果您真的想使用此功能,我建议您获取代码并在项目中创建自己的库模块。谢谢,下载,添加为模块,并使用本教程编辑:Works now
allprojects {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.github.THEONE10211024:WaterDropListView:7b51373b3b'
}
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'