问题描述
我在android studio 1.0.0中制作了一个模块库.从那开始,我拿了.aar文件&用它来其他项目.但是,在将我的android studio更新为1.1.0时,我没有从中获得任何参考.
I made a module library in android studio 1.0.0. From that I took the .aar file & used it to other project. But after updating my android studio to 1.1.0 when I import it, I does not get any reference from it.
做一些研究,我发现它是build.gradle中的gradle build版本
Doing some research I found that it is for gradle build version in build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
如果将其降级为1.0.0,则可以找到.aar文件(1.0.0)中的所有引用.但是我认为这不是最好的解决方案.因此,任何帮助都是有意义的.
If downgrade it to 1.0.0 then any references from .aar file(1.0.0) are found. But I think this is not best solution. So, any help would be appreciable.
谢谢
推荐答案
在项目窗口中(按Alt+1
)>切换到Project
视图(从此窗口顶部开始),按名称在app
中创建一个文件夹aar
.
从myLibrary.aar
复制并放入app/aar
.然后
in project window (press Alt+1
) > switch to Project
view (from top of this window), create a folder in app
by name aar
.
make a copy from myLibrary.aar
and put in app/aar
. then
在MyProject > build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'aar'
}
}
}
并在MyProject/app > build.gradle
dependencies {
...
compile(name: 'myLibrary', ext: 'aar')
}
它正在为我工作! :)
it's working for me! :)
这篇关于Android Studio 1.1.0不会从1.0.0版获取aar文件构建的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!