Why would my Android app throw an SSL Exception when built using Gradle, but not when built using Eclipse?

Trying to convert an existing Eclipse project to use Gradle for CI builds. The APK builds just fine and everything appears to be in order, until I try and make a connection to my backend server, with our self signed certificate.

That’s when I get a


that says

Trust anchor for certification not found

When building via Eclipse, the exact same code runs as expected; connecting just fine. I have double-checked that the assets folder is included properly in the Gradle build script, that the InputStream is loading the data correctly, and that it matches byte-for-byte the data that is read in when Eclipse builds the APK.

After loading, I also verified that the KeyStore has the same aliases and certificates available in both builds. No exceptions are thrown during this initialization by either build.

Using Gradle 1.10 building for Android SDK v.17

ADT mailing list - http://groups.google.com/group/adt-dev - is a better place for this question. I think you will have much higher chance to get an answer there. People will likely ask more questions about your problem: Java version used for your build in Eclipse / with Gradle, version of Android Gradle plugin and so on.