问题
I'm trying to build a signed apk (release) using proguard, but when generating the APK android studio reports several warnings related to "net.sourceforge.jtds" like this:
Warning:net.sourceforge.jtds.jdbcx.JtdsDataSource: can't find superclass or interface javax.sql.XADataSource
Warning:net.sourceforge.jtds.jdbcx.JtdsDataSource: can't find superclass or interface javax.naming.Referenceable
...
and finally ends with an error:
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. java.io.IOException: Please correct the above warnings first.
do I have to configure proguard to "ignore" jtds? how ?
any help would be greatly appreciated.
回答1:
The warning means that you are missing some dependent libraries. The missing classes (javax.naming.Referenceable
or javax.sql.XADataSource
) are present in a standard Java 7 SDK, but not in the android.jar
(as you are building for android).
I am not aware if the used library (jtds) works well with Android, but in case it does you can add the following to your configuration to instruct ProGuard to ignore the warnings:
-dontwarn net.sourceforge.jtds.**
Otherwise you might need to add the missing libraries for android, e.g. jndi.
来源:https://stackoverflow.com/questions/38268898/android-signed-apk-net-sourceforge-jtds-errors