解决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'
}
相关推荐
Vfw3VsDKo15 小时前
Android设备搭建本地RTSP服务器(基于live555)
android·运维·服务器
九狼JIULANG15 小时前
【无标题】
android·flutter·开源·github
jwn99915 小时前
Laravel10.x新特性全解析
android
CDN36015 小时前
iOS/Android 集成游戏盾审核被拒?权限与合规配置修复
android·游戏·ios
huwuhang1 天前
Winkawaks街机游戏模拟器整合ROM版 1.65 汉化修正完整版 2026.03.30
android·游戏·游戏机
yitian_hm1 天前
MySQL主从复制与读写分离实战指南
android·mysql·adb
NEGl DRYN1 天前
Plugin ‘mysql_native_password‘ is not loaded`
android·数据库·mysql
藤谷性能1 天前
Ubuntu 22.04:安装Android Studio
linux·ubuntu·android studio
Derrick__11 天前
Android混淆和加密技术
android·jvm·python
sunwenjian8861 天前
MySQL加减间隔时间函数DATE_ADD和DATE_SUB的详解
android·数据库·mysql