I'm currently trying to move an old project from eclipse to Android Studio. The project contains a "core module" (contains a lot of network stuff), an Android app and a Java PC application which both include the core module to communicate with each other. Each app and the core have a own repo.
When using eclipse the app, the PC applicaton and the core were three independet eclipse projects in the same workspace and the two apps where depending on the core project.
I successfully moved the Android app to Android Studio and the core to IntelliJ with gradle. I now try to tell Android Studio to compile the core when building the app. My file structure looks like this:
GitHub
------\ AndroidApp
----------------\ build.gradle
----------------\ settings.gradle
----------------\ app
---------------------\ build.grale
------\ NetworkCore
----------------\ build.gradle
----------------\ settings.gradle
AndroidApp/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
AndroidApp/settings.gradle
include ':app', 'core'
project(':core').projectDir = new File('../NetworkCore')
AndroidApp/app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "xxxxxxxxxxx"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:19.1.0'
compile project(':core')
}
NetworkCore/build.gradle
group 'xxxxxxxxxx'
version '1.0-SNAPSHOT'
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
NetworkCore/settings.gradle
rootProject.name = 'xxxxxxx'
The Issue
Android Studio detects core as module and properly lists all files in the left sidebar. But when compiling Android Studio is not able to find the classes from core and sometime even the classes from the app module (like Fragment classes etc.).
What am I doing wrong? Thank you very much in advance :)