I use a self-written library-module within another project like it was suggested in
https://code.google.com/p/android/issues/detail?id=105570
and
Android Studio 0.8.1 Creating Modules without copying files?
I added the lines to settings.gradle and furthermore added the included library via "Project Structure"-Dialog as a dependency to the project. I use Android Studio 1.2.2.
Everything within the IDE looks fine (imports are working, library-code can be browsed and edited, both modules can be "maked" without errors), but I can't seem to launch the project on my phone / emulator.
I get a "classNotFoundException" for the first class from the library that is used in the app.
I copy-pasted the entire project class by class from Eclipse where it would run without problems.
What do I have to do to get the compiled classes of the library into my app onto my phone?
settings.gradle
include ':app'
include ':Sudoku'
project(':Sudoku').projectDir=new File('/../Libs/sudoku')
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.frozenmilkmeteoroids.sudokuapp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile project(':Sudoku')
}
build.gradle (library)
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}