解决Android Studio不能创建aidl文件问题

如图,在准备创建aidl文件时选项置灰

仔细看其实就是配置文件的问题,在build.gradle(:app)下的配置添加

gradle 复制代码
    buildFeatures {
        aidl true
    }

完整配置如下:

gradle 复制代码
plugins {
    id 'com.android.application'
}

android {
    namespace 'com.example.aidl'
    compileSdk 34

    defaultConfig {
        applicationId "com.example.aidl"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        aidl true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
相关推荐
冬奇Lab6 小时前
AudioRecord音频录制流程深度解析
android·音视频开发·源码阅读
alexhilton9 小时前
Jetpack Compose中的富文本输入
android·kotlin·android jetpack
兄弟加油,别颓废了。9 小时前
ctf.show_web4
android
哔哔龙11 小时前
Android OpenCV 实战:图片轮廓提取与重叠轮廓合并处理
android·算法
tangweiguo0305198712 小时前
Android SSE 流式接收:从手写到框架的进阶之路
android
大尚来也13 小时前
PHP 反序列化漏洞深度解析:从原理利用到 allowed_classes 防御实战
android·开发语言·php
sp42a13 小时前
通过 RootEncoder 进行安卓直播 RTSP 推流
android·推流·rtsp
SY.ZHOU14 小时前
移动端架构体系(一):组件化
android·ios·架构·系统架构
恋猫de小郭15 小时前
Android 17 新适配要求,各大权限进一步收紧,适配难度提升
android·前端·flutter
流星白龙15 小时前
【MySQL】9.MySQL内置函数
android·数据库·mysql