I'm trying to create an android application that depends on java code from a java library module, but whenever I try to use any objects from that java library, I always get the following
Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_121\bin\java.exe'' finished with non-zero exit value 1
I've looked at the following Execution failed for task ':app:transformClassesWithDexForDebug' while implementing Google sign in for Android and I've tried pretty much every suggestion, but it still won't build. My java library does use the json library that android uses, and I get a few warnings about that, but it says it will just be ignored
Here's my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "pwils33.familymap"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries false
incremental true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':shared')
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.android.support:multidex:1.0.1'
}
I'm using the module for another java application that I've built so I can't convert it into an android library. Any help would be appreciated
EDIT I've tried making my application a multi dex application as well, that's not working either, here's my manifest for the application
<?xml version="1.0" encoding="utf-8"?>
<manifest package="pwils33.familymap"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name="android.support.multidex.MultiDexApplication">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>