Comments (6)
我这边貌似是可以的,我尝试找下原因。。
from androuter.
hey, 我发现问题了, 我必须要在 Project/build.gradle 中加入 maven { url ...} 才行. 我在 module/build.gradle 中加入是不行的... 这不应该的.
我再看看是不是加入的位置是否正确
from androuter.
哦,原来你这是一个文件 = ,=。 还有那个repository 应该是放在allprojects节点下的,buildscript是给gradle用的,而这里是表示你的项目依赖于这些repository,所以应该放在allprojects节点下。这是我的项目gradle文件,可以参考下。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://jitpack.io"
}
maven {
url "http://dl.bintray.com/populov/maven"
}
maven{
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
from androuter.
恩, 谢谢你的回复.
我们的主工程下有多个 module, 我放在 module/build.gradle 中也是为了不污染别的 module. 所以期望能把这个 module 依赖的东西都包在自己内部.
不过我们的 project 中的多个 module 之间还有相互引用, 所以最终还是不得已要写在 project/build.gradle 中.
谢谢你热心的回复.
from androuter.
我个人觉得放在project里面没有什么问题。buildscript里面的内容是只跟编译时用的gradle有关系的,表示gradle要依赖这些库,而跟项目本身关系不大。而在allprojects里面只需要加repository,只是表示项目内依赖的库可以从这些仓库里面找,只是标记了一下,也不会更改实际的项目内容,所以不会对moudle的实际内容产生影响。
from androuter.
恩, 你说的没错.
from androuter.
Related Issues (19)
- Fragment HOT 2
- Routers should support multi schemes. HOT 1
- 考虑RouterManager被系统回收的问题 HOT 1
- Save the Activity stack HOT 1
- Any schema mapping support HOT 1
- 请问自定义Router在Application中怎么初始化? HOT 2
- 跑了一遍Demo发现RouterMap不生效 HOT 2
- 能否继承AppCompatActivity HOT 1
- 可以不适用注解去生成配置吗? HOT 2
- 容错性 HOT 2
- 自动生成注解的template模板 HOT 4
- deeplinking HOT 1
- 不能加载依赖插件 HOT 6
- 是否把apt换成annotationProcessor HOT 2
- 按配置弄好但是加载不到库 HOT 1
- 支持多个module吗 HOT 3
- 对于url参数中有#的兼容性问题 HOT 1
- 想要获取对应的activiy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androuter.