nisrulz / easydeviceinfo

:iphone: [Android Library] Get device information in a super easy way.
Apache License 2.0
1.76k stars 228 forks source link

app start err #1

Closed jp1017 closed 8 years ago

jp1017 commented 8 years ago
java.lang.RuntimeException: Unable to start activity ComponentInfo{in.excogitation.deviceinfo/in.excogitation.deviceinfo.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToFirst()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2528)
    at android.app.ActivityThread.access$800(ActivityThread.java:169)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5552)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToFirst()' on a null object reference
    at in.excogitation.a.a.I(Unknown Source)
    at in.excogitation.deviceinfo.MainActivity.onCreate(Unknown Source)
    at android.app.Activity.performCreate(Activity.java:5975)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
    ... 10 more
nisrulz commented 8 years ago

Hi @jp1017 could you not run proguard and then tell me where exactly are you getting this error from

at in.excogitation.a.a.I(Unknown Source)

Also l am guessing this is an issue since you are trying to get the user agent and if you read the Readme file you will see I have marked it to be called on the Main Thread ,for which you have to implement either runOnUiThread or use a Handler

jp1017 commented 8 years ago

This app comes from https://play.google.com/store/apps/details?id=in.excogitation.deviceinfo

It works well on your device?

My device is red Mi Note 3.

nisrulz commented 8 years ago

@jp1017 ohh , I thought it was an issue in the library. So I have to update the app. Give me a day or two and it will be updated. I made quite a lot of changes in the library code. Also the app is not open source however the code it uses is this library (albeit not the current version).

Thank you for reporting.

Closing the issue since its not related to the library.