我创建了一个 Android 应用程序,我想使用“Linphone”库进行语音和视频通话。
我成功下载并设置了库项目,但是当我运行项目时,在“LinphoneService.java”文件中出现以下错误。
我在这行中收到错误:
LinphoneCoreFactory.instance().setLogCollectionPath(
getFilesDir().getAbsolutePath());
LinphoneCoreFactory.instance().enableLogCollection(
!(getResources().getBoolean(R.bool.disable_every_log)));
例外:
03-07 17:35:41.400: D/AndroidRuntime(8217): Shutting down VM
03-07 17:35:41.400: W/dalvikvm(8217): threadid=1: thread exiting with uncaught exception (group=0x417e4da0)
03-07 17:35:41.400: E/AndroidRuntime(8217): FATAL EXCEPTION: main
03-07 17:35:41.400: E/AndroidRuntime(8217): Process: org.linphone, PID: 8217
03-07 17:35:41.400: E/AndroidRuntime(8217): java.lang.RuntimeException: Unable to create service org.linphone.LinphoneService: java.lang.NullPointerException
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2824)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.app.ActivityThread.access$1900(ActivityThread.java:172)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.os.Handler.dispatchMessage(Handler.java:102)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.os.Looper.loop(Looper.java:146)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.app.ActivityThread.main(ActivityThread.java:5653)
03-07 17:35:41.400: E/AndroidRuntime(8217): at java.lang.reflect.Method.invokeNative(Native Method)
03-07 17:35:41.400: E/AndroidRuntime(8217): at java.lang.reflect.Method.invoke(Method.java:515)
03-07 17:35:41.400: E/AndroidRuntime(8217): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
03-07 17:35:41.400: E/AndroidRuntime(8217): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
03-07 17:35:41.400: E/AndroidRuntime(8217): at dalvik.system.NativeStart.main(Native Method)
03-07 17:35:41.400: E/AndroidRuntime(8217): Caused by: java.lang.NullPointerException
03-07 17:35:41.400: E/AndroidRuntime(8217): at org.linphone.LinphoneService.onCreate(LinphoneService.java:140)
03-07 17:35:41.400: E/AndroidRuntime(8217): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2814)
03-07 17:35:41.400: E/AndroidRuntime(8217): ... 10 more