Hello We Try Create B4A library for portsip sdk. This sdk link :
http://www.portsip.com/sites/downloads/sdk/AndroidSample_Eclipse.zip
We try eclipse and SLC , we get similar errors.
Where our mistake dont understand.. This Library very importand for as.
our simple test code:
And our Java code :
Our Errors :
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2373)
at android.app.ActivityThread.access$1600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at b4a.example.starter.onCreate(starter.java:37)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at b4a.example.starter.onCreate(starter.java:35)
... 11 more
Caused by: java.lang.ExceptionInInitializerError
at b4a.example.main._process_globals(main.java:367)
at b4a.example.main.initializeProcessGlobals(main.java:357)
... 14 more
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load portsip_core: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.portsiplib.PortSip.<clinit>(PortSip.java:9)
... 16 more
And SLC logs :
Starting step: Compiling Java code.
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Loading source file C:\Users\hakanunver\Desktop\SimpleLibraryCompiler\PortSip\src\com\example\PortSip.java...
Constructing Javadoc information...
[-doclet, BADoclet]
[-docletpath, C:\Users\hakanunver\Desktop\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, C:\Users\hakanunver\Desktop\SimpleLibraryCompiler]
[-bootclasspath, C:\Users\hakanunver\AppData\Local\Android\sdk\platforms\android-23\android.jar]
[-classpath, C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;C:\Users\hakanunver\Desktop\SimpleLibraryCompiler\PortSip\libs\portsipvoipsdk.jar;]
[-sourcepath, src]
[-b4atarget, C:\Users\hakanunver\Desktop\aaaa\PortSip.xml]
[-b4aignore, org.com.android.com.portsip.com.portsip]
Ignoring: [org.com.android.com.portsip.com.portsip]
starting....
Working with class: com.portsiplib.PortSip
finish: C:\Users\hakanunver\Desktop\aaaa\PortSip.xml
Completed successfully.
*** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
http://www.portsip.com/sites/downloads/sdk/AndroidSample_Eclipse.zip
We try eclipse and SLC , we get similar errors.
Where our mistake dont understand.. This Library very importand for as.
our simple test code:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim portsip As PortSip
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
portsip.Initialize_Sip("333","zkr333","192.168.1.233",5222)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
And our Java code :
B4X:
package com.portsiplib;
import com.portsip.PortSipSdk;
import android.content.Context;
import anywheresoftware.b4a.BA.ShortName;
@ShortName("PortSip")
public class PortSip {
static{
System.loadLibrary("portsip_core");
System.loadLibrary("portsip_media");
}
public String Initialize_Sip(String username,String password,String server,int port){
PortSipSdk sdk = new PortSipSdk();
return "RUN";
}
}
Our Errors :
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2373)
at android.app.ActivityThread.access$1600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at b4a.example.starter.onCreate(starter.java:37)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at b4a.example.starter.onCreate(starter.java:35)
... 11 more
Caused by: java.lang.ExceptionInInitializerError
at b4a.example.main._process_globals(main.java:367)
at b4a.example.main.initializeProcessGlobals(main.java:357)
... 14 more
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load portsip_core: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at com.portsiplib.PortSip.<clinit>(PortSip.java:9)
... 16 more
And SLC logs :
Starting step: Compiling Java code.
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Loading source file C:\Users\hakanunver\Desktop\SimpleLibraryCompiler\PortSip\src\com\example\PortSip.java...
Constructing Javadoc information...
[-doclet, BADoclet]
[-docletpath, C:\Users\hakanunver\Desktop\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, C:\Users\hakanunver\Desktop\SimpleLibraryCompiler]
[-bootclasspath, C:\Users\hakanunver\AppData\Local\Android\sdk\platforms\android-23\android.jar]
[-classpath, C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;C:\Program Files (x86)\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;C:\Users\hakanunver\Desktop\SimpleLibraryCompiler\PortSip\libs\portsipvoipsdk.jar;]
[-sourcepath, src]
[-b4atarget, C:\Users\hakanunver\Desktop\aaaa\PortSip.xml]
[-b4aignore, org.com.android.com.portsip.com.portsip]
Ignoring: [org.com.android.com.portsip.com.portsip]
starting....
Working with class: com.portsiplib.PortSip
finish: C:\Users\hakanunver\Desktop\aaaa\PortSip.xml
Completed successfully.
*** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***