【发布时间】:2017-08-24 19:58:43
【问题描述】:
我正在尝试运行我的一个旧项目,所以我将它导入 Android Studio(它在我最初创建它时使用它)并更新了库(之前它也不会运行)
问题是,即使构建成功(只有警告),我得到Gradle project sync failed. 并且无法运行它。
我目前正在运行 gradle 的最新 alpha (2.4.0-alpha3),尝试了旧版本以查看是否存在问题,并且还尝试更改依赖项、版本和构建工具。我还有来自同一个SdkVersion 的其他工作项目,所以可能不是这样。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26-rc1'
defaultConfig {
applicationId "com.jediburrell.sof"
minSdkVersion 15
targetSdkVersion 26
versionCode 7
versionName "1.6"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.github.afollestad.material-dialogs:core:0.8.5.4@aar') {
transitive = true
}
compile files('libs/activation.jar')
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
compile 'org.apache.httpcomponents:httpclient:+'
}
关于警告:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
Information:BUILD SUCCESSFUL
Information:Total time: 1.27 secs
Information:0 errors
Information:1 warning
Information:See complete output in console
我尝试在没有HttpClient 的情况下构建它。它构建相同的
【问题讨论】: