解决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'
}
相关推荐
花王江不语2 小时前
android studio 配置硬件加速 haxm
android·ide·android studio
江太翁4 小时前
mediapipe流水线分析 三
android·mediapipe
与火星的孩子对话4 小时前
Unity进阶课程【六】Android、ios、Pad 终端设备打包局域网IP调试、USB调试、性能检测、控制台打印日志等、C#
android·unity·ios·c#·ip
tmacfrank5 小时前
Android 网络全栈攻略(四)—— TCPIP 协议族与 HTTPS 协议
android·网络·https
fundroid6 小时前
Kotlin 协程:Channel 与 Flow 深度对比及 Channel 使用指南
android·kotlin·协程
草字6 小时前
cocos 打包安卓
android
DeBuggggggg7 小时前
centos 7.6安装mysql8
android
浩浩测试一下8 小时前
渗透信息收集- Web应用漏洞与指纹信息收集以及情报收集
android·前端·安全·web安全·网络安全·安全架构
移动开发者1号9 小时前
深入理解原子类与CAS无锁编程:原理、实战与优化
android·kotlin
陈卓4109 小时前
MySQL-主从复制&分库分表
android·mysql·adb