- Could not resolve com.android.su
- Could not resolve com.android.su
- Could not resolve com.android.su
- Could not resolve com.android.su
- Could not resolve all dependenci
- gradle could not resolve all dep
- Could not resolve all dependenci
- cocoapods pod install 报错
- maven打包jar时,出现Failed to execute
- Error:Could not resolve all file
今天刚刚从Android 2.3 升级到Android studio 3.0.1,刚刚新建了一个项目,就出现一个bug
![](https://img.haomeiwen.com/i2973177/26b23c180dcc3e37.png)
具体错误日志如下:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:27+.
Could not resolve com.android.support:appcompat-v7:27+.
Required by:
project :app
> No cached version listing for com.android.support:appcompat-v7:27+ available for offline mode.
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27+.
Could not resolve com.android.support:appcompat-v7:27+.
Required by:
project :app
> No cached version listing for com.android.support:appcompat-v7:27+ available for offline mode.
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27+.
Could not resolve com.android.support:appcompat-v7:27+.
Required by:
project :app
> No cached version listing for com.android.support:appcompat-v7:27+ available for offline mode.
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:27+.
Could not resolve com.android.support:appcompat-v7:27+.
Required by:
project :app
> No cached version listing for com.android.support:appcompat-v7:27+ available for offline mode.
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27+.
Could not resolve com.android.support:appcompat-v7:27+.
Required by:
project :app
> No cached version listing for com.android.support:appcompat-v7:27+ available for offline mode.
解决方法
在Android studio 中 File -> Settings... -> Build,Execution,Deployment -> Gradle 中将Global gradle settings 中的"Offline work" 勾选去掉,再重新编译,即可将所缺的库从google仓库上下载。
![](https://img.haomeiwen.com/i2973177/015641f4c3b4ab8a.png)
编译ok即可将"将Offline work" 勾选上,这样以后新建的工程就不需要每次上google仓库下载了。
网友评论