2 qq 38192902 qq_38192902 于 2017.08.29 21:50 提问

app安装后点击闪退,log如下,请问是什么问题啊,麻烦各位指教一下

08-29 21:37:56.458 4962-4962/? I/art: Late-enabling -Xcheck:jni
08-29 21:37:56.618 4962-4962/com.example.coolweather W/System: ClassLoader referenced unknown path: /data/app/com.example.coolweather-1/lib/arm64
08-29 21:37:56.674 4962-4962/com.example.coolweather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-29 21:37:56.745 4962-4962/com.example.coolweather D/AndroidRuntime: Shutting down VM
08-29 21:37:56.745 4962-4962/com.example.coolweather E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.coolweather, PID: 4962
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.coolweather/com.example.coolweather.MainActivity}: java.lang.NumberFormatException: null
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2768)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1481)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6153)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)
Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:483)
at java.lang.Integer.parseInt(Integer.java:556)
at org.litepal.parser.LitePalParser.usePullParse(LitePalParser.java:160)
at org.litepal.parser.LitePalParser.parseLitePalConfiguration(LitePalParser.java:102)
at org.litepal.parser.LitePalAttr.loadLitePalXMLConfiguration(LitePalAttr.java:99)
at org.litepal.parser.LitePalAttr.getInstance(LitePalAttr.java:90)
at org.litepal.tablemanager.Connector.buildConnection(Connector.java:104)
at org.litepal.tablemanager.Connector.getWritableDatabase(Connector.java:63)
at org.litepal.tablemanager.Connector.getDatabase(Connector.java:87)
at org.litepal.crud.DataSupport.findAll(DataSupport.java:1027)
at org.litepal.crud.DataSupport.findAll(DataSupport.java:994)
at com.example.coolweather.ChooseAreaFragment.queryProvinces(ChooseAreaFragment.java:115)
at com.example.coolweather.ChooseAreaFragment.onActivityCreated(ChooseAreaFragment.java:106)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2201)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1326)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2900)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:603)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1249)
at android.app.Activity.performStart(Activity.java:6722)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2768) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1481) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6153) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758) 
08-29 21:37:56.752 4962-4962/? I/Process: Sending signal. PID: 4962 SIG: 9

5个回答

zgy621101
zgy621101   Rxr 2017.08.30 09:03
ziyejinwei1994
ziyejinwei1994   2017.08.30 10:33

at com.example.coolweather.ChooseAreaFragment.queryProvinces(ChooseAreaFragment.java:115) 是不是这一行出错了

stone_you
stone_you   2017.08.30 14:21

Caused by: java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:483)
at java.lang.Integer.parseInt(Integer.java:556)
at org.litepal.parser.LitePalParser.usePullParse(LitePalParser.java:160)
at org.litepal.parser.LitePalParser.parseLitePalConfiguration(LitePalParser.java:102)
at org.litepal.parser.LitePalAttr.loadLitePalXMLConfiguration(LitePalAttr.java:99)
at org.litepal.parser.LitePalAttr.getInstance(LitePalAttr.java:90)
at org.litepal.tablemanager.Connector.buildConnection(Connector.java:104)
at org.litepal.tablemanager.Connector.getWritableDatabase(Connector.java:63)
at org.litepal.tablemanager.Connector.getDatabase(Connector.java:87)
at org.litepal.crud.DataSupport.findAll(DataSupport.java:1027)
at org.litepal.crud.DataSupport.findAll(DataSupport.java:994)
at com.example.coolweather.ChooseAreaFragment.queryProvinces(ChooseAreaFragment.java:115)

Integer.parseInt方法传进去的是null,看下queryProvinces方法里调用的参数有没有问题吧

qq_36255612
qq_36255612   2017.08.31 16:59

你这是有一个操作是数字类型转换类型吧,首先数字为null,然后拿一个空的东西去操作怎么可能?

dongfeng9ge
dongfeng9ge   Ds   Rxr 2017.09.02 18:05

Integer.parseInt方法传进去的是null,做个判空吧

Csdn user default icon
上传中...
上传图片
插入图片