I'm getting the above error when I run my program with ./gradlew spoon, but not when I run my tests regularly. I can't seem to find much on the issue, but after digging around it seems like there's an issue with some of my dependencies being incompatible, however I can't figure it out.

Here's my build.gradle file:

buildscript {
    repositories {
        maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        mavenCentral()
    }

    dependencies {
        classpath 'com.jaredsburrows:gradle-spoon-plugin:1.6.0'
        //classpath 'com.jaredsburrows:gradle-spoon-plugin:latest.integration'
    }
}

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id "com.jaredsburrows.spoon" version "1.6.0"
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
    }
}

spoon {
    baseOutputDir = "$buildDir/reports/spoon-output"
    devices = ["emulator-5554"]
    grantAll = true
    //className = "myTest.ButtonTests"
}

dependencies {
    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
    implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'

    //I added these
    //androidTestImplementation('androidx.test:core:1.4.0')
    androidTestImplementation 'com.squareup.spoon:spoon-client:1.7.1'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0')
    //androidTestImplementation('androidx.test:runner:1.4.0')
    androidTestImplementation('androidx.test:rules:1.4.0')
}

0

There are 0 best solutions below