Skip to content

Custom debugApk setting gets overwritten if instrumentationApk is not set #172

Description

@Egorand

Our project has the following configuration:

fladle {
  variant = "internalDebug"

  debugApk = project.provider {
    "$buildDir/outputs/apk/internal/debug/app-internal-debug-universal.apk"
  }
}

Surprisingly, this fails with the following error:

'/.../app/build/outputs/apk/internal/debug/app-internal-debug.apk' not found 

From looking at the code, it seems that if either debugApk or instrumentationApk is not set the plugin will try to locate those files automatically, overwriting debugApk in the process:

if (!base.debugApk.isPresent || !base.instrumentationApk.isPresent) {
findDebugAndInstrumentationApk(project, base)
}

Indeed, providing the default path to the instrumentation APK explicitly resolves the issue:

fladle {
  variant = "internalDebug"

  debugApk = project.provider {
    "$buildDir/outputs/apk/internal/debug/app-internal-debug-universal.apk"
  }
  instrumentationApk = project.provider {
    "$buildDir/outputs/apk/androidTest/internal/debug/app-internal-debug-androidTest.apk"
  }
}

debugApk and instrumentationApk should probably be resolved independently to support use cases where one of the values is a custom path while the other is default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions