I have a runtime error when i try to run my android application, due to the importation of this package that allows me to use Watson Services.
'com.ibm.watson.developer_cloud:java-sdk:2.9.0'
In fact, when I use something related to this package, the error that appears is:
E/dalvikvm: Could not find class 'javax.naming.InitialContext', referenced from method com.ibm.watson.developer_cloud.util.CredentialUtils.getKeyUsingJNDI
and the corresponding stacktrace is:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: semantic.myapplication, PID: 29120
java.lang.VerifyError: com/ibm/watson/developer_cloud/util/CredentialUtils
at….
I’ve looked for the real problem of this error and I’ve found that in the file “CredentialUtils.java” where the error appears, these three importations are not recognized (Cannot resolve symbols):
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
I use Android Studio and the latest version of jdk (1.8.0.77). These java files exist, I can see them but for some reason are not accessible: the importation of every file in javax.naming (and also other folders) is not possible.
How can I solve this problem? I’ve tried to import a .jar file including the javax.naming classes, but doesn’t work. Is there a way to make visible that classes?
Any help would be appreciated. Thanks!