I'm trying something very simple that is well documented, but I can't get it to work.
I am using AndroidStudio 0.6.0 with build tools version 19.1.0. Running on OSX.
I create an new project with a blank activity. Lets call it MyApp.
I put a jar file in MyApp/app/libs.
I right-click on the jar and select 'Add As Library'.
I run 'gradlew clean' and 'gradlew assemble'.
At this point, I expect the jar to be in the apk file but it is not. My gradle dependencies section looks like this:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.bob.myapplication6.app"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile files('libs/openCVLibrary249.jar')
}
I tried adding the apk dependency, i.e.:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile files('libs/openCVLibrary249.jar')
apk files('libs/openCVLibrary249.jar')
}
But still no jar in the apk file. What do I have to do to get the jar in the apk file?
Thank you.