Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Studio3.1.3 app build.gradle出现错误 #211

Closed
5 tasks done
zhizhulp opened this issue Jun 8, 2018 · 6 comments
Closed
5 tasks done

Android Studio3.1.3 app build.gradle出现错误 #211

zhizhulp opened this issue Jun 8, 2018 · 6 comments

Comments

@zhizhulp
Copy link

zhizhulp commented Jun 8, 2018

Environment

  • MVPArms Version:2.4.1
  • AndroidStudio Version: 3.1.3
  • Gradle Plugin Version: 3.1.2
  • Target Android Version: no
  • Device Model: no

Bug Log:

Failed to resolve: common
Open File
Failed to resolve: common
Open File
以上4行是控制台输出
Open File 打开的文件时build.gradle,但是没有具体的错误。
注:Android Studio 3.1.3强制使用gradle4.4及4.4以上。不知道跟gradle是否有关系。

### Others:
@JessYanCoding
Copy link
Owner

JessYanCoding commented Jun 9, 2018

你好, 我把 AS 升到 3.1.3, Gradle 插件也升到了 3.1.3, 其他一些项目都全部升到 3.1.3,并没有发现有什么错误, 都是完美运行

你这个问题就如同你说的和 AS 或者 Gradle 有关, 但和框架并没有什么关系

@zhizhulp
Copy link
Author

谢谢作者,我会继续测试。看看问题到底出在哪里。

@zhizhulp
Copy link
Author

我依然没有找出原因,但是项目莫名奇妙地好了。我只是pull了一下,然后点击了一下gradle中的try again。

@JessYanCoding
Copy link
Owner

... , AndroidStuido 就是这样

@zhizhulp
Copy link
Author

现在已经知道原因 (注意是自己的项目不是demo)
将 project build.gradle中的
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }//RxCache 需要 jitpack 仓库
maven { url "https://maven.google.com" }//Support-library 需要 Google 仓库
google() //AndroidStudio v3.0 可以使用 google() 替代 maven { url "https://maven.google.com
}
}
改为
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
可以解决以上问题,因为这三个仓库是有优先级的。

@JessYanCoding
Copy link
Owner

对,我上个星期,在 travis 平台上也意识到了这个问题,已经把 google() 放到了 jcenter() 前面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants