Gradle同步失败-无法解决:appcompat-v7:26 [英] Gradle sync failed - Failed to resolve: appcompat-v7:26
问题描述
我在我的app/build.gradle中使用此代码.
I use this code in my app/build.gradle.
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.avizhegroup.android.dsmmaps"
minSdkVersion 21
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
implementation 'com.android.volley:volley:1.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.github.zookey:universalpreferences:0.0.4'
implementation 'com.google.android.gms:play-services-location:11.0.4'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.bosphere.android-filelogger:filelogger:1.0.3'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.orhanobut:logger:2.2.0'
implementation 'com.orhanobut:logger:2.1.1'
implementation 'com.orhanobut:dialogplus:1.11@aar'
implementation files('libs/usbdriver.jar')
implementation files('src/main/libs/rlmotgusbdriver.jar')
implementation 'me.imid.swipebacklayout.lib:library:1.1.0'
implementation 'com.felipecsl.asymmetricgridview:library:2.0.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
}
同步Gradle时出现问题.这些问题已经发生:
I have a problem when syncing Gradle. these problems have occurred:
错误:无法解决:设计
受影响的模块:app
错误:无法解决:appcompat-v7
受影响的模块:app
错误:无法解决:过渡
受影响的模块:app
错误:无法解决:recyclerview-v7
受影响的模块:app
错误:无法解决:support-v4
受影响的模块:app
错误:无法解决:support-media-compat
受影响的模块:app
错误:无法解决:animated-vector-drawable
受影响的模块:app
错误:无法解决:support-vector-drawable
受影响的模块:app
错误:无法解决:支持片段
受影响的模块:app
错误:无法解决:support-core-utils
受影响的模块:app
错误:无法解决:support-core-ui
受影响的模块:app
错误:无法解决:support-compat
受影响的模块:app
错误:无法解决:支持注释
受影响的模块:app
错误:无法解决:运行时
受影响的模块:app
错误:无法解决:常见
受影响的模块:应用
ERROR: Failed to resolve: design
Affected Modules: app
ERROR: Failed to resolve: appcompat-v7
Affected Modules: app
ERROR: Failed to resolve: transition
Affected Modules: app
ERROR: Failed to resolve: recyclerview-v7
Affected Modules: app
ERROR: Failed to resolve: support-v4
Affected Modules: app
ERROR: Failed to resolve: support-media-compat
Affected Modules: app
ERROR: Failed to resolve: animated-vector-drawable
Affected Modules: app
ERROR: Failed to resolve: support-vector-drawable
Affected Modules: app
ERROR: Failed to resolve: support-fragment
Affected Modules: app
ERROR: Failed to resolve: support-core-utils
Affected Modules: app
ERROR: Failed to resolve: support-core-ui
Affected Modules: app
ERROR: Failed to resolve: support-compat
Affected Modules: app
ERROR: Failed to resolve: support-annotations
Affected Modules: app
ERROR: Failed to resolve: runtime
Affected Modules: app
ERROR: Failed to resolve: common
Affected Modules: app
我取消了实验"中的首选项中的变体,更改了依存关系,更改了SDK版本,更改了等级版本....此代码在Windows中有效,但在Mac中则无效.
我使用约束布局和AndroidStudio3.3.2
我该如何纠正?
谢谢
I uncheck variant in Experimental in preferences, change dependencies, change SDK version, change grade version and ... . this code works in windows, but in Mac doesn't.
I use constraint-layout and AndroidStudio3.3.2
How can I correct this?
Thanks
推荐答案
将Google maven添加到您的根build.gradle
中,如下所示:
Add google maven to your root build.gradle
like below:
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
这篇关于Gradle同步失败-无法解决:appcompat-v7:26的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!