解决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'
}
相关推荐
2501_916008891 小时前
iOS 性能测试的深度实战方法 构建从底层指标到真实场景回放的多工具测试体系
android·ios·小程序·https·uni-app·iphone·webview
w***95491 小时前
SQL美化器:sql-beautify安装与配置完全指南
android·前端·后端
r***12382 小时前
若依微服务中配置 MySQL + DM 多数据源
android·mysql·微服务
ALex_zry3 小时前
MySQL连接数管理与优化实操经验分享
android·mysql·adb
apigfly4 小时前
深入Android系统(十三)Android的窗口系统
android·设计模式·源码
k***85844 小时前
【SpringBoot】【log】 自定义logback日志配置
android·前端·后端
S***q1924 小时前
Kotlin内联函数优化
android·开发语言·kotlin
小墙程序员4 小时前
在Android中,kotlin 的一些开发技巧(二)
android·kotlin
曾经的三心草4 小时前
JavaEE初阶-多线程1
android·java·java-ee
q***73555 小时前
windows配置永久路由
android·前端·后端