在接入某视频SDK的过程中,properties发生空指针错误,一开始的方向是以为properties错误或SDK代码错误。
java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.ActivityThread.installProvider(ActivityThread.java:4807) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException: in == null at java.util.Properties.load(Properties.java:246) at com.letv.datastatistics.db.StatisContentProvider.<clinit>(StatisContentProvider.java:24) at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.ActivityThread.installProvider(ActivityThread.java:4807) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4432) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
解决方案:
把properties放在(或新建在)src文件夹下面。
时间: 2024-10-25 07:41:48