android support 26,java-“无法解决:com.android.support:support-v4:26.0.0”和Gradle syn上的其他类似错误...

这个问题已经在这里有了答案:

无法解决:com.android.support:cardview-v7:26.0.0 android 24个答案

我刚刚为Android Mobile和Wear创建了一个新的Android Studio项目。 最初的gradle构建失败,因为我遇到了几个错误-

Install repository and sync project

Install repository and sync project

Install repository and sync project

Install repository and sync project

对于每个错误,都为我提供了Install repository and sync project的选项,但是当我单击它时什么也没有发生。 我花了几个小时试图找出为什么会出现这些错误,但找不到任何解决方案。 有人知道如何解决这些非常令人沮丧的错误吗? 谢谢!

build.gradle(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {

jcenter()

maven {

url "https://maven.google.com"

}

}

dependencies {

classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong

// in the individual module build.gradle files

}

}

allprojects {

repositories {

jcenter()

}

}

task clean(type: Delete) {

delete rootProject.buildDir

}

build.gradle(移动)

apply plugin: 'com.android.application'

android {

compileSdkVersion 26

buildToolsVersion "26.0.1"

defaultConfig {

applicationId "com.georgeberdovskiy.androidweartest"

minSdkVersion 23

targetSdkVersion 26

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {

exclude group: 'com.android.support', module: 'support-annotations'

})

wearApp project(':wear')

compile 'com.google.android.gms:play-services-wearable:11.0.4'

compile 'com.android.support:appcompat-v7:26+'

compile 'com.android.support.constraint:constraint-layout:1.0.2'

compile "com.android.support:support-core-utils:26+"

testCompile 'junit:junit:4.12'

}

build.gradle(磨损)

apply plugin: 'com.android.application'

android {

compileSdkVersion 26

buildToolsVersion "26.0.1"

defaultConfig {

applicationId "com.georgeberdovskiy.androidweartest"

minSdkVersion 23

targetSdkVersion 26

versionCode 1

versionName "1.0"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

provided 'com.google.android.wearable:wearable:2.0.4'

compile 'com.google.android.support:wearable:2.0.4'

compile 'com.google.android.gms:play-services-wearable:11.0.4'

compile "com.android.support:support-core-utils:26+"

}

我确定我的Android Studio版本已更新,并且安装了所有支持存储库和API。

WhapN.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,你在使用Android Studio运行项目时遇到了报错。报错信息显示无法解析com.android.support:appcompat-v7:26.0.0-beta1这个依赖项。这可能是由于以下原因导致的: 1. 你的项目中没有正确配置依赖项。请确保在项目的build.gradle文件中正确添加了com.android.support:appcompat-v7:26.0.0-beta1这个依赖项。 2. 你的网络连接可能存在问题,导致无法下载依赖项。请检查你的网络连接,并尝试重新构建项目。 3. 你的本地Maven仓库可能缺少com.android.support:appcompat-v7:26.0.0-beta1这个依赖项。你可以尝试手动下载并安装这个依赖项,或者更新你的Android SDK以确保你的本地仓库是最新的。 解决这个问题的方法有: 1. 检查依赖项配置:打开你的项目的build.gradle文件,确保以下代码片段存在并且没有错误: ```groovy dependencies { implementation 'com.android.support:appcompat-v7:26.0.0-beta1' // 其他依赖项... } ```*** 更新Android SDK:打开Android SDK Manager,确保你的Android Support Repository和Google Repository是最新的版本。如果不是最新版本,更新它们并重新构建项目。 4. 手动下载依赖项:如果以上方法都无效,你可以尝试手动下载com.android.support:appcompat-v7:26.0.0-beta1这个依赖项,并将它添加到你的项目中。你可以在Maven仓库或者其他可靠的第三方仓库中找到这个依赖项的下载链接。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值