无法升级到最新的支持库Android Studio [英] Cannot upgrade to latest support library Android Studio

查看:460
本文介绍了无法升级到最新的支持库Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了最新版本的Android Support Repository(47.0.0),但由于出现以下错误,我无法构建我的项目。

错误



这是我的构建.gardle代码

  compileSdkVersion 26 
buildToolsVersion '26 .0.1'
defaultConfig {
applicationId ir.dones.dones
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
vectorDrawables.useSupportLibrary = true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt') ,'proguard-rules.pro'
}
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVe rsion.VERSION_1_8
}

依赖关系

 执行fileTree(包括:['* .jar'],dir:'libs')
androidTestImplementation('com.android.support.test.espresso:espresso- core:2.3-alpha',{
exclude group:'com.android.support',module:'support-annotations'
})
implementation'com.android.support:support- compat:26.0.0'
implementation'com.android.support:support-v4:26.0.0'
implementation'com.android.support:appcompat-v7:26.0.0'
'com.android.support:support-core-utils:26.0.0'
implementation'com.android.support:design:26.0.0'
implementation'com.android.support:support- vector-drawable:26.0.0'
implementation'com.android.support:recyclerview-v7:26.0.0'
implementation'com.android.support:cardview-v7:26.0.0'
implementation'com.getbase:floatingactionbutton:1.10.1'
implementation'com.google.cod e.gson:gson:2.8.1'
implementation'de.hdodenhof:circleimageview:2.1.0'
implementationat.blogc:expandabletextview:1.0.3
testImplementationjunit: junit:4.12

我已经完成了Android Studio建议将支持库升级到26.0的内容。 2版本,但据我所知没有这样的版本发布。



Android Studio建议

这样做再次遇到了同样的错误。我在存储库中尝试过google()和maven(),但didn也没有帮助。将支持版本更改为26. +是我可以构建项目的唯一方式,但这种方式无法使用Xml中用于Api的字体等新功能。



我正在使用Android Studio Canary 8.



任何帮助将不胜感激。

解决方案

毕竟这是一个代理问题。我不得不用这行代替gradle.properties中的默认行:

  org.gradle.jvmargs = -DsocksProxyHost = 127.0.0.1 -DsocksProxyPort = 9090 

花了我一个星期的时间才发现它。感谢那些回答或评论并试图帮助的人。


I have installed the latest version of Android Support Repository (47.0.0), but I can't build my project because of the following error.

ERROR

Here is my build.gardle code

compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
    applicationId "ir.dones.dones"
    minSdkVersion 17
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary= true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

dependencies

implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.3-alpha', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:support-compat:26.0.0'
implementation 'com.android.support:support-v4:26.0.0'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:support-core-utils:26.0.0'
implementation 'com.android.support:design:26.0.0'
implementation 'com.android.support:support-vector-drawable:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation 'com.android.support:cardview-v7:26.0.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation "at.blogc:expandabletextview:1.0.3"
testImplementation "junit:junit:4.12"

I have done what is suggested by Android studio to upgrade the support libraries to 26.0.2 version but as I know there is no such version released.

Android Studio suggestion

Doing so again I hit the same error.I tried google() and maven() in repositories but didn't help either. Changing support version to 26.+ is the only way I can build the project, but this way I can't use new features like fonts in Xml for Api<26.

I'm using Android studio Canary 8.

Any help would be appreciated.

解决方案

It was a proxy issue after all.I had to replace the default lines in gradle.properties with this line:

org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=9090

It took me a week to find it out.thanks to those who answered or commented and tried to help.

这篇关于无法升级到最新的支持库Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆