singwhatiwanna / dynamic-load-apk

DL : dynamic load framework in android
http://blog.csdn.net/singwhatiwanna/article/details/40283117
Other
6.03k stars 1.99k forks source link

DLProxyService奇怪空指针 #147

Open haiblee opened 8 years ago

haiblee commented 8 years ago

java.lang.RuntimeException: Unable to bind to service com.lib.dynamicload.DLProxyService@420c19d8 with Intent { cmp=com.package,name/com.lib.dynamicload.DLProxyService (has extras) }: java.lang.NullPointerException at android.app.ActivityThread.handleBindService(ActivityThread.java:2643) at android.app.ActivityThread.access$1700(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5183) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.lib.dynamicload.internal.DLServiceProxyImpl.init(SourceFile:46) at com.lib.dynamicload.DLProxyService.onBind(SourceFile:30) at android.app.ActivityThread.handleBindService(ActivityThread.java:2630) ... 10 more java.lang.NullPointerException at com.lib.dynamicload.internal.DLServiceProxyImpl.init(SourceFile:46) at com.lib.dynamicload.DLProxyService.onBind(SourceFile:30) at android.app.ActivityThread.handleBindService(ActivityThread.java:2630) at android.app.ActivityThread.access$1700(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5183) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method)

第二个: java.lang.RuntimeException: Unable to stop service com.lib.dynamicload.DLProxyService@42327610: java.lang.NullPointerException at android.app.ActivityThread.handleStopService(ActivityThread.java:3030) at android.app.ActivityThread.access$2300(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1410) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5653) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.lib.dynamicload.DLProxyService.onDestroy(SourceFile:88) at android.app.ActivityThread.handleStopService(ActivityThread.java:3013) ... 10 more java.lang.NullPointerException at com.lib.dynamicload.DLProxyService.onDestroy(SourceFile:88) at android.app.ActivityThread.handleStopService(ActivityThread.java:3013) at android.app.ActivityThread.access$2300(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1410) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5653) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method)

分析了很久尚未找到原因,请指教

mengfantao commented 6 years ago

强制杀死进程时候报这个问题,目前我直接做了非空判断