我在源代码中使用了aidl文件,但与代码库下的apk版本相比,Andorid Studio中的一个版本具有包含.aidl文件的额外文件夹。这是正常的吗?这些* .aidl文件不应该包装在classes.dex?(或resources.arsc?)中 我也尝试过使用
packagingOptions {
exclude './src/com/mytest/test/*.aidl'
}
但它不起作用! 以下是我的build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.mytest.test"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1"
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard-apk.config'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
//androidTest.setRoot('../tests')
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude './src/com/mytest/test/*.aidl'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
答案 0 :(得分:1)