Is it normal that the *.aidl files appeared in the folder of the unzipped apk build within Android Studio

…衆ロ難τιáo~ 提交于 2019-12-13 02:36:51

问题


I used aidl files in my source codes, but compare to the apk build under code base, the one build within Andorid Studio has extra folder that contains .aidl files. Is that normal? Shouldn't these *.aidl files be wrapped in classes.dex?(or resources.arsc?) I also had tried to use

packagingOptions { 
    exclude './src/com/mytest/test/*.aidl' 
} 

but it doesn't work! following is my 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'])
}

回答1:


Thought it seems passed a long time, I still want to post to help you. I met the same problem, I resolved it! try to remove resources.srcDirs = ['src'] in you build.gradle this indicate java resource not android resource, the res already indicate android resource



来源:https://stackoverflow.com/questions/36347480/is-it-normal-that-the-aidl-files-appeared-in-the-folder-of-the-unzipped-apk-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!