Cordova plugin package android.javax.sip does not exist

I want to build a Cordova plugin for Ionic app, and this plugin I think I have already imported the library (here is the java code, as you can see I write the import statement)

package session;

import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.PluginResult;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;
import android.Manifest;
import android.os.Handler;
import android.javax.sip.Dialog;

import java.lang.ref.WeakReference;


public class MediaSipSession extends CordovaPlugin{
    private static String TAG = "MediaSipSession";

    public static CallbackContext callCallback;
    private CallbackContext RTCPCallbackContext;
    private Dialog dialog;

And I also add the source-file tag in my plugin.xml ( android-jain-sip-ri-1.2.342.jar have the class which name android.javax.sip)

<source-file src="libs/android-4.1.1.4.jar" target-dir="libs/android-4.1.1.4.jar"></source-file>
<source-file src="libs/android-jain-sip-ri-1.2.342.jar" target-dir="libs/android-jain-sip-ri-1.2.342.jar"></source-file>

so I run ionic Cordova build android, expect Ionic will build an android APK for android platform, but I get the error, it say

error: package android.javax.sip does not exist
import android.javax.sip.Dialog;

symbol:   class Dialog
location: class MediaSipSession
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

hope anyone can fix this problem.

I found the way to solve this problem.

If you want to use the library, should use the lib-file tag to define the .jar file, not the source-file tag :smile: