解决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'
}
相关推荐
实时云渲染dlxyz66883 分钟前
点盾云安卓版手机/平板播放器使用教程
android·点盾云播放·点盾云安卓使用·点盾云安卓播放器·加密播放
nix.gnehc3 分钟前
OpenClaw 安卓设备接入指南:从零开始配置你的移动节点
android·openclaw
RDCJM10 小时前
【MySQL】在MySQL中STR_TO_DATE()以及其他用于日期和时间的转换
android·数据库·mysql
冬奇Lab11 小时前
AudioFlinger架构基础:Android音频系统的心脏
android·音视频开发·源码阅读
铁手飞鹰12 小时前
Visual Studio创建Cmake工程导出DLL,通过Python调用DLL
android·python·visual studio
冰语竹17 小时前
Android学习之相对布局
android
没有了遇见17 小时前
Android 中大型项目架构梳理
android
yashuk17 小时前
【MySQL】表的相关操作
android·mysql·adb
71-317 小时前
Android studio中真机操作
android·笔记·学习·其他·android studio
一只特立独行的Yang18 小时前
Android Focus小结
android