I have an application code in an Android studio that I want to convert to a library project so that I can use it as a library in another application.
The build.gradle project from the library is as follows
apply plugin: 'com.android.library' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 24 buildToolsVersion "24.0.3" defaultConfig { //applicationId "com.example" minSdkVersion 16 targetSdkVersion 24 versionCode 1 versionName "1.0" jackOptions { enabled true } multiDexEnabled true } dexOptions { javaMaxHeapSize "4g" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) testCompile 'junit:junit:4.12' /* support libraries*/ compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.android.support:design:23.1.0' compile 'com.android.support:recyclerview-v7:23.1.0' compile 'com.android.support:support-v4:23.1.0' compile 'com.android.support:support-annotations:23.1.0' /* google play services libraries*/ compile 'com.google.android.gms:play-services-location:9.0.0' }
I am using android studio 2.2.1 and jdk 1.8,
jdk 1.8 requires jackOptions
He says:
Error: library projects cannot enable Jack. Jack is included in the default configuration. if I disable jackOptions, then my library does not work due to jdk 1.8, it says jackOptions are necessary and get the following errors.
app:generateDebugSources app:mockableAndroidJar app:prepareDebugUnitTestDependencies app:generateDebugAndroidTestSources myapplication:generateDebugSources myapplication:generateDebugAndroidTestSources myapplication:mockableAndroidJar myapplication:prepareDebugUnitTestDependencies
source share