我在我的項目中的兩個模塊:包含在Android Studio中的APK模塊依賴
- 應用
- app_list
兩個模塊有Java和資源。 app_list
有一些我想在app
中推出的活動。
在Eclipse中,我將app_list作爲依賴庫,並且我能夠啓動app_list
的活動。在Android Studio中,當我加入app_list
的依賴,它說:
"Error:A problem occurred configuring project ':app'.
> Dependency NewMathBuzz:app_list:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: <home>/NewMathBuzz/app_list/build/outputs/apk/app_list-release-unsigned.apk
"
應用程序>的build.gradle是如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.mass.mathbuzz"
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':app_list')
compile fileTree(dir: 'libs', include: ['*.jar'])
}
app_list>的build.gradle是如下:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.android.support:appcompat-v7:22.0.0'
}
有人可以幫助我嗎?
apk文件不能依賴。你做錯了什麼 –
@Vlad然後我該怎麼做,基本上app_list有我想在許多應用程序中包含的通用活動,所以我正在製作廣告模塊 –
顯示你的build.gradle –