Loading [MathJax]/jax/input/TeX/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Unable to resolve dependency for问题?

Unable to resolve dependency for问题?

提问于 2018-08-20 08:07:02
回答 1关注 1查看 2.7K

报错信息:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@release/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.2.0)

以下是我的代码内容:

app目录下的build.gradle文件:

代码语言:javascript
运行
AI代码解释
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.uratio.rxjavademo2"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.+'
    implementation 'com.android.support:design:28.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
//    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
//    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}

项目目录下的build.gradle文件:

代码语言:javascript
运行
AI代码解释
复制
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle-wrapper.properties文件内容:

代码语言:javascript
运行
AI代码解释
复制
#Wed Aug 15 16:44:09 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

这个问题该怎么解决,好像是现在这个配置,导入什么框架都会报错,搜了网上的错误,没有一个和我的报错完全一样的(除了框架名不同),求解答!

回答 1

用户3117884

发布于 2018-08-31 02:59:05

楼主楼主,后来这个问题你解决了吗,我遇到一模一样的问题,网上都没找到方法,离线模式也没开,不懂为什么会这样

和开发者交流更多问题细节吧,去 写回答
相关文章
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve
如题,从 git 上 clone 下来的代码,直接用 Android Studio 打开就报这个错:
程序员飞飞
2020/03/02
3.1K0
Unable to resolve dependency for ‘xxx项目@debug/compileClasspath‘: Could not resolve com.jakew
Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta3. Required by: project :app No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode. No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode. Could not resolve com.android.support:design:26.1.0. Required by: project :app No cached version of com.android.support:design:26.1.0 available for offline mode. No cached version of com.android.support:design:26.1.0 available for offline mode. Could not resolve com.android.support:cardview-v7:26.1.0. Required by: project :app No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode. No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode. Could not resolve com.google.android.gms:play-services-ads:11.4.2. Required by: project :app No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode. No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode. Could not resolve com.android.support:support-v4:26.1.0. Required by: project :app No cached version of com.android.support:support-v4:26.1.0 available for offline mode. No cached version of com.android.support:support-v4:26.1.0 available for offline mode.   
再见孙悟空_
2023/02/10
5050
Unable to resolve dependency for ‘xxx项目@debug/compileClasspath‘: Could not resolve com.jakew
npm ERR! ERESOLVE unable to resolve dependency tree的解决方法
在 package.json 文件中,存在一个叫做 peerDependencies(对等依赖关系)的对象,它包含了项目里需要的所有的包或用户正在下载的版本号相同的所有的包。
德顺
2022/09/20
3.1K0
wget unable to resolve host address>问题>解决方法
>问题 今天在CDH资源上 http://archive.cloudera.com/cdh5/cdh/5/ 下载 hive-1.1.0-cdh5.7.0 http://archive.cloudera.com/cdh5/cdh/5/hive-1.1.0-cdh5.7.0.tar.gz 在客户端窗口上执行 wget -c http://archive.cloudera.com/cdh5/cdh/5/hive-1.1.0-cdh5.7.0.tar.gz 报错了: Resolving archive.clo
sparkle123
2018/04/28
6K0
wget unable to resolve host address>问题>解决方法
sudo unable to resolve host错误
从/etc/hosts 设定, 让dev(hostname) 可以解回127.0.0.1 的IP 即可. /etc/hosts 原始内容
JavaEdge
2022/11/29
4970
Linux下fsck.ext4:Unable to resolve问题记录
在(or type control -D to continue):后面输入root密码后回车
試毅-思伟
2018/09/06
2.2K0
Linux下fsck.ext4:Unable to resolve问题记录
git pull fails “unable to resolve reference” “unable to update local ref”
问题 由于有人rebase了分支,或者不知道怎么搞的。其他人拉取代码的时候,发现拉不下来。 >git fetch error: cannot lock ref 'refs/remotes/origin/xxx-branch': is at 8117caf7b1c88b2d5dfebd7581f6891d87b9abee but expected f38e8d35ae8ea7f177c537a98f4140dd76b8e2bd From xxxxxxx-git-url ! f38e8d35..9d7b8e
Ryan-Miao
2018/03/14
9080
sudo 出现unable to resolve host 解决方法
sudo 出现unable to resolve host 解决方法 Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息: sudo: unable to resolve host abc 虽然sudo 还是可以正常执行, 但是警告讯息每次都出来,而这只是机器在反解上的问题, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可.
学到老
2019/02/14
2.8K0
sudo 出现unable to resolve host 解决方法
sudo 出现unable to resolve host 解决方法 Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息: sudo: unable to resolve host abc 虽然sudo 还是可以正常执行, 但是警告讯息每次都出来,而这只是机器在反解上的问题, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可. /etc/hosts 原始内容
学到老
2018/03/19
3.2K0
monorepo 项目 Unable to resolve path to module ‘xxx‘.eslintimport/no-unresolved
Unable to resolve path to module '@/app/Prisma'.eslintimport/no-unresolved
星宇大前端
2023/06/01
4260
monorepo 项目 Unable to resolve path to module ‘xxx‘.eslintimport/no-unresolved
git fetch 失败,因为 unable to resolve reference 'refs/remotes/origin/xxx': reference broken
我在使用 git fetch 命令的时候,发现竟然会失败,提示错误 error: cannot lock ref 'refs/remotes/origin/xxx': unable to resolve reference 'refs/remotes/origin/xxx': reference broken。
walterlv
2023/10/23
2.4K0
git fetch 失败,因为 unable to resolve reference 'refs/remotes/origin/xxx': reference broken
"Unable to start embedded Tomcat" 问题
网上说了很多解决办法, 有的是手动配置配置一个外置的Tomcat, 有的说是jar包冲突. 仔细想想应该都没有把握核心, Springboot已经集成了内置的Tomcat, 所以没有必要再配置一个外置的Tomcat. 错误日志有一句信息很重要:
芥末鱿鱼
2022/05/05
1.7K0
asp.net5发神经一例 ------无法加载依赖
通过dnu restore也不管用。查看一下运行环境吧(好像我尝试过升级dnvm update-self):
申君健
2018/09/21
5620
asp.net5发神经一例  ------无法加载依赖
vue Failed to resolve loader: stylus-loader问题
在项目运行中会出现如下图所示的问题,出现Failed to resolve loader: stylus-loade 问题原因,是因为在项目中使用了lang=“stylus”, 项目中并没有安装stylus-loade和stytus , 安装即可。执行代码如下:
tongyao
2022/06/09
4850
vue Failed to resolve loader: stylus-loader问题
idea 报 Dependency not found 无法引入依赖的问题
idea 的 pom 文件修改,只要信息是对的都能从官方镜像仓库拉下来对应依赖,但是就是非常神奇,竟然出现了 maven 官方中央仓库有的依赖 idea 就是报错 Dependency not found。
灰太狼学Java
2022/06/17
2.9K2
dependency graph
Process: Break down your requirements to user stories (vertical slices through your tech stack that DELIVER VALUE TO YOUR USERS) and add these to your board. Find out which ones have dependencies outside your team/project. Use pins and string to draw a lin
PM吃瓜
2023/03/02
4820
dependency graph
Flutter: Failed to notify project evalution listener
又是一个常见的flutter的环境问题,一般发生在引用了plugin之后。因为默认的gradle,kotlin之类的比较旧,而所引用的plugin里面的gradle,kotlin比较新。所以会有这个问题,如图:
JarvanMo
2018/10/25
1.2K0
点击加载更多

相似问题

小程序调试部,体验版报错 request:fail Unable to resolve host ?

12.4K

Nginx配置resolve报错?

0183

swift组件化开发,s.dependency 'TUIChat'依赖后出现问题?

0114

Unable to bind to http://localhost:5000 on the IPv6 loopback interface.问题?

24.1K

E200002: Unable to connect to?

1331
相关问答用户
某公司 | 程序员擅长1个领域
新浪微博 | 高级总监擅长4个领域
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档