I'm trying to include an Android App into a java project using Gradle. The goal is to import the app and write the test on the Java project.
So far my tries had failed and I'm getting this error:
Error:Configuration with name 'default' not found.
The error comes with this configuration (on the line compileOnly project(path: ':app', configuration: "")):
<!-- language: lang-java -->
//java/build.gradle
apply plugin: 'java'
dependencies {
compileOnly project(path: ':app', configuration: "")
}
//java/settings.gradle
include ':app_test', ':app'
project(':app').projectDir = new File("../androidApp")
Android App gradle
// /androidApp/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "app.com.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
task showConfig {
doLast {
println rootProject.configurations
}
}
Anyway to fix this? or Just have a template how to do it?