ext { junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.8.0' } apply plugin: 'com.android.library' // Apply the Kotlin Android plugin so the plugin's .kt class is bundled into the // library AAR. Without it AGP's built-in kotlinc compiles the sources but does // NOT bundle the .class files, so the Capacitor plugin class is absent from the // app dex at runtime (PluginLoadException -> the whole plugin set fails to load). apply plugin: 'org.jetbrains.kotlin.android' android { namespace = "ai.eliza.plugins.system" compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 defaultConfig { minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 // Instrumented (androidTest) runner — exercises SystemDeviceReader's real // device reads on a connected device/emulator (issue #9967). testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = "17" } } repositories { google() maven { url = uri(rootProject.ext.has('mavenCentralMirrorUrl') ? rootProject.ext.mavenCentralMirrorUrl : 'https://repo.maven.apache.org/maven2') } mavenCentral() } dependencies { implementation project(':capacitor-android') implementation "androidx.activity:activity:$androidxActivityVersion" // Instrumented test deps (issue #9967 — first androidTest for a native plugin). androidTestImplementation "androidx.test:core:1.5.0" androidTestImplementation "androidx.test:runner:1.5.2" androidTestImplementation "androidx.test.ext:junit:1.1.5" }