我想使用 this library在 Android Studio 的一个项目中,如阅读我所述,我在 Android Studio 中创建了新项目,并在 app 文件夹内的 build.gradle 文件中添加了依赖项:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.mycompany.swipe_instagram"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.lorentzos.swipecards:library:1.0.8@aar'
}
然后,当我同步时,我开始收到此错误:
我在谷歌和堆栈溢出上进行了搜索,但找不到任何合适的解决方案。
最佳答案
我使用了你的“build.gradle”文件,它对我来说工作正常(有和没有“aar”)。可能是缓存有问题。尝试“文件-> 使缓存无效/重新启动”)。生成更多错误消息详细信息的另一种方法是尝试从命令行构建模块并获取详细输出
gradle -info compileDebugSources
你会得到很多输出,这些输出应该给你一个关于出了什么问题的提示
关于android - 无法在 Android Studio 中使用 github 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28262751/