简体   繁体   中英

No cached version of com.android.tools.build:gradle:2.3.3 and commons-logging:commons-logging:1.1.1 available for offline mode

My gradle settings are thus : 摇篮设置

I have tried degrading the gradle build tool version to 2.3.2, have tried with both offline checked and unchecked and with both the default gradle wrapper and my local gradle installation. Nothing seems to work. The on project runs successfully but it fails with the following error (detailed): on项目成功运行,但失败,并显示以下错误(详细信息):

Error:Gradle: A problem occurred configuring root project 'Project_Name'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:2.3.3.
Required by:
project :
No cached version of com.android.tools.build:gradle:2.3.3 available for offline mode.
Could not resolve commons-logging:commons-logging:1.1.1.
Required by:
project : > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2 > org.codehaus.groovy.modules.http-builder:http-builder:0.7.2 > org.apache.httpcomponents:httpclient:4.2.1
project : > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2 > org.codehaus.groovy.modules.http-builder:http-builder:0.7.2 > net.sf.json-lib:json-lib:2.3
project : > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2 > org.codehaus.groovy.modules.http-builder:http-builder:0.7.2 > net.sf.json-lib:json-lib:2.3 > commons-beanutils:commons-beanutils:1.8.0
No cached version of commons-logging:commons-logging:1.1.1 available for offline mode.

Surprisingly, it deployed successfully the last time, which must have been a couple of weeks back. I did not do any configuration changes neither any updates to the Android Studio or related components. So I have no idea why this error has appeared out of the blue while deployment.

Edit 1: I have to mention that even though such questions exist on SO, none of the solutions mentioned there solved this issue. They were all suggesting disabling offline work, but it was never enabled in the first place in my project.

Edit 2 : Adding the gradle files:

  1. Project gradle file: 项目gradle文件

  2. App module gradle file: App module gradle file

Sounds like a transitive dependency issue. First are you targeting Oreo? if so, make sure you include the new google/maven repo pointer in your build.gradle file.

If not or if you have already done this, then try including the commons-logging 1.1.1 file that the bintry-plugin is requiring.

Are any of the dependencies listed in your yellow yours? Could just be a transitive dependency missing that needs either included or excluded.

Also make sure you have the correct gradle repos setup for pulling the 2.3.2. Can you share your project gradle file as well as your gradle.properties and your settings.gradle and any other applicable gradle file that you are using. I'm sure we can get you up and going again.

Resolving dependencies is a pain, but you can usually hunt it down if you do a bash gradlew assembleRelease --debug and see where/how the issue shows itself first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM