我正在尝试运行我的一个旧项目,所以我将其导入了Android Studio(最初创建时使用了它)并更新了库(之前都不会运行)
问题是,即使构建成功(仅发出警告),我仍然得到Gradle project sync failed.
并且无法运行它。
我目前正在运行gradle的最新alpha版本(2.4.0-alpha3),尝试使用较旧的版本来查看是否是问题所在,并且还尝试更改依赖项,版本和buildtools。我还有其他来自相同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
来构建它。它建立相同
最佳答案
两个建议:
关于android - Gradle构建成功,但不会同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43125552/