2
我在我的图书馆项目中遇到了一个问题。我已经在lib的build.gradle
中添加了支持依赖项,并且在我的代码中使用了它们。当我构建要在Maven
上使用的.aar
文件时,支持依赖关系被“忽略”,它们不被我使用lib的项目看到。支持库不支持aar
这是我收到的lib的gradle
警告:
Dependency on a support library, but the SDK installation does not have the "Extras > Android Support Repository" installed. Open the SDK manager and install it.
显然我已经安装了支持库的最后一个版本。
这里是LIB的gradle产出:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:design:22.2.0'
}
}
在我的项目中,我在styles.xml添加的lib的依赖,例如,我看不到程序兼容性主题。
这里是应用程序的gradle产出:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "giorgioantonioli.fondesa.spesapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile ('com.fondesa:antoniolimaterial:[email protected]'){ //lib
transitive = true;
}
}
@HugoGresse现在我不能尝试它,但是当我要做的时候,我会写回应 –
@HugoGresse,但没有解决问题 –
我试过你是代码,它的工作原理应该如此。一定要更新SDK(我知道你说你有,但...)https://www.dropbox.com/s/gcz6rxfjgxf3l14/Capture%20d%27%C3%A9cran%202015-06-16%2011.33。 12.png?dl = 0 –