【发布时间】:2018-01-09 01:55:12
【问题描述】:
我正在尝试将以下支持库添加到我的 buid.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 26
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 11
targetSdkVersion 26
}
signingConfigs {
release {
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:support-v7:26.0.0'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.melnykov:floatingactionbutton:1.1.0'
compile 'it.sephiroth.android.library.imagezoom:imagezoom:1.0.5'
//Apptentive
compile 'com.apptentive:apptentive-android:2.1.3@aar'
//compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.0.0'
}
我收到错误消息,指出每个库“无法解析”,然后是上面的每一行代码。我希望与最新的支持库保持同步,以获取常规支持、appcompat 和 cardview。
【问题讨论】:
-
确保您已禁用离线模式。
-
你能提供基本的说明吗?
-
转到首选项 > Gradle 并取消选中“离线工作”。在 Android Studio 中打开设置并搜索离线它会找到包含离线工作的 Gradle 类别。你可以在那里禁用它。
-
其实已经没有勾选了……
标签: android gradle android-support-library