10

I have a problem with my Android project and Gradle 1.5. I am not able to compile my dependencies I added. Currently I am developing an Java EE application and I want to perform an EJB lookup from my Android device to my running Wildfly10.

I know, doing a lookup from an android device might not be the best option, a REST webservice would be better, but thats not the point here.

In my project I added a new module, containing all my external libs, and I added this module to my :app as dependency on "compile" level. Everything just works fine, until I want to add the jboss-client.jar. During dex, he is complaining about the javax.transaction.*.

What I have done for now

Why they are not working

    1. solution: I modified my dx.bat in every build-tool I have .. nothing changed. It's just not working
    1. solution: com.android.build.gradle.tasks.Dex is not known (and I have no idea how to add), coreLibrary is not supported with Gradle 1.5
    1. solution: is completely ignored by gradle

The projects minSDK is 19 and targetSDK is 23 with build-tool 23.0.2 I called the dx.bat from command-line with the same parameters as gradle, I only added the --core-library arg and it works! But that doesnt solve the problem within Android Studio and Gradle.

Can anyone please help me?

UPDATE: Okay, I had a look at the source code of com.android.dx.command.Main. There is a public inner class "Arguments" which contains (apperently) the arguments which can be used, also the coreLibrary=false. Now I only need to know how to modify it. Does anybody know?

Best regards, Chris

Community
  • 1
  • 1

1 Answers1

5

This worked for me:

 dexOptions {
    preDexLibraries = false
    additionalParameters =["--core-library"]
  }
Yrlec
  • 3,401
  • 6
  • 39
  • 75
  • 1
    Glad I could help! I made it a bounty because I was stuck myself. Luckily I found this by pure accident. – Yrlec Nov 11 '16 at 12:43