解决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'
}
相关推荐
4 小时前
深度解析Compose中的BoxWithConstraints
android·kotlin·android jetpack
jolimark4 小时前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb
book123_0_995 小时前
【MySQL】MySQL函数之JSON_EXTRACT
android·mysql·json
冬奇Lab5 小时前
ContentProvider与Uri权限:跨应用数据共享
android·源码阅读
峥嵘life6 小时前
Android16 【GTS】 GtsDevicePolicyTestCases 测试存在Failed项
android·linux·学习
aqi006 小时前
【送书活动】《鸿蒙HarmonyOS 6:应用开发从零基础到App上线》迎新送书啦
android·华为·harmonyos·鸿蒙
良逍Ai出海7 小时前
OpenClaw 新手最该先搞懂的 2 套命令
android·java·数据库
hindon8 小时前
一文读懂 ViewModel
android
程序员JerrySUN8 小时前
别再把 HTTPS 和 OTA 看成两回事:一篇讲透 HTTPS 协议、安全通信机制与 Mender 升级加密链路的完整文章
android·java·开发语言·深度学习·流程图
音视频牛哥8 小时前
Android平台GB28181设备接入模块架构解析、功能详解与典型应用场景分析
android·android gb28181·gb28181安卓端·gb28181对接·gb28181设备·gb28181语音广播·安卓gb28181设备对接