Hi,
I download the code from github "git://git.linphone.org/linphone-android.git --recursive
" of linphone and compiled it with ndk but when i go to adroid tools->add native support then it will making files in jni folder. But i saw that no library files in libs folder, i think which creates exception(ExceptionInInitializerError) because System.loadlibrary can not find the libraries.
In class LinphoneCoreFactoryImpl at static block there is an exception at code
/* it is lin phone library avutil-linphone-x86*/
// FFMPEG (audio/video)
if (Version.isX86()) {
loadOptionalLibrary("avutil-linphone-x86");
loadOptionalLibrary("swscale-linphone-x86");
loadOptionalLibrary("avcodec-linphone-x86");
} else if (Version.isArmv7()) {
loadOptionalLibrary("avutil-linphone-arm");
loadOptionalLibrary("swscale-linphone-arm");
loadOptionalLibrary("avcodec-linphone-arm");
}
actually call comes from this part :
private static boolean loadOptionalLibrary(String s) {
try {
System.loadLibrary(s);
return true;
} catch (Throwable e) {
Log.w("Unable to load optional library lib", s);
e.printStackTrace();
}
return false;
}
Exception i got :
/06-05 03:58:03.031: E/AndroidRuntime(11005): FATAL EXCEPTION: main 06-05 03:58:03.031: E/AndroidRuntime(11005): java.lang.ExceptionInInitializerError 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.Class.classForName(Native Method) 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.Class.forName(Class.java:217) 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.Class.forName(Class.java:172) 06-05 03:58:03.031: E/AndroidRuntime(11005): at org.linphone.core.LinphoneCoreFactory.instance(LinphoneCoreFactory.java:44) 06-05 03:58:03.031: E/AndroidRuntime(11005): at org.linphone.LinphoneManager.startLibLinphone(LinphoneManager.java:473) 06-05 03:58:03.031: E/AndroidRuntime(11005): at org.linphone.LinphoneManager.createAndStart(LinphoneManager.java:238) 06-05 03:58:03.031: E/AndroidRuntime(11005): at org.linphone.LinphoneService.onCreate(LinphoneService.java:156) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2504) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.app.ActivityThread.access$1600(ActivityThread.java:149) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.os.Handler.dispatchMessage(Handler.java:99) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.os.Looper.loop(Looper.java:153) 06-05 03:58:03.031: E/AndroidRuntime(11005): at android.app.ActivityThread.main(ActivityThread.java:4987) 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.reflect.Method.invokeNative(Native Method) 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.reflect.Method.invoke(Method.java:511) 06-05 03:58:03.031: E/AndroidRuntime(11005): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) 06-05 03:58:03.031: E/AndroidRuntime(11005): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 06-05 03:58:03.031: E/AndroidRuntime(11005): at dalvik.system.NativeStart.main(Native Method) 06-05 03:58:03.031: E/AndroidRuntime(11005): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load linphone-armeabi-v7a: findLibrary returned null 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.Runtime.loadLibrary(Runtime.java:365) 06-05 03:58:03.031: E/AndroidRuntime(11005): at java.lang.System.loadLibrary(System.java:535) 06-05 03:58:03.031: E/AndroidRuntime(11005): at org.linphone.core.LinphoneCoreFactoryImpl.(LinphoneCoreFactoryImpl.java:62) 06-05 03:58:03.031: E/AndroidRuntime(11005): ...
Please reply why this exception occurs, could be the reason is that the github project does not have libraries.