Could not find class 'android.hardware.display.DisplayManager', referenced from method org.acra.collector.DisplayManagerCollector.collectDisplays

118 views
Skip to first unread message

Ashok Subedi

unread,
Aug 22, 2016, 5:33:50 PM8/22/16
to acra-discuss
Hi,

I tried to implement ACRA on my project on eclipse. I put the acra-4.9.0 jar file on libs folder, and followed the basic steps to send report to my google docs spreedsheet that matches the template provided.

My implementation is like this

public class MyApplication extends Application {
....
@Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

        // The following line triggers the initialization of ACRA
        ACRA.init(this);
    }
}

ARCA catches error but doesn't send anything to my google docs. Following is my stacktrace

08-22 17:21:13.981: E/ACRA(29928): ACRA caught a NullPointerException for com.ashok.subedi.myapp

08-22 17:21:13.981: E/ACRA(29928): java.lang.NullPointerException

08-22 17:21:13.981: E/ACRA(29928):         at com. ashok.subedi. myapp.main.MainActivity.onClick(MainActivity.java:138)

08-22 17:21:13.981: E/ACRA(29928):         at android.view.View.performClick(View.java:4260)

08-22 17:21:13.981: E/ACRA(29928):         at android.view.View$PerformClick.run(View.java:17417)

08-22 17:21:13.981: E/ACRA(29928):         at android.os.Handler.handleCallback(Handler.java:615)

08-22 17:21:13.981: E/ACRA(29928):         at android.os.Handler.dispatchMessage(Handler.java:92)

08-22 17:21:13.981: E/ACRA(29928):         at android.os.Looper.loop(Looper.java:137)

08-22 17:21:13.981: E/ACRA(29928):         at android.app.ActivityThread.main(ActivityThread.java:4962)

08-22 17:21:13.981: E/ACRA(29928):         at java.lang.reflect.Method.invokeNative(Native Method)

08-22 17:21:13.981: E/ACRA(29928):         at java.lang.reflect.Method.invoke(Method.java:511)

08-22 17:21:13.981: E/ACRA(29928):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)

08-22 17:21:13.981: E/ACRA(29928):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)

08-22 17:21:13.981: E/ACRA(29928):         at dalvik.system.NativeStart.main(Native Method)

08-22 17:21:14.072: W/dalvikvm(29928): VFY: unable to resolve virtual method 1006: Landroid/os/StatFs;.getBlockSizeLong ()J

08-22 17:21:14.072: W/dalvikvm(29928): VFY: unable to resolve virtual method 1006: Landroid/os/StatFs;.getBlockSizeLong ()J

08-22 17:21:14.242: E/dalvikvm(29928): Could not find class 'android.hardware.display.DisplayManager', referenced from method org.acra.collector.DisplayManagerCollector.collectDisplays

08-22 17:21:14.242: W/dalvikvm(29928): VFY: unable to resolve check-cast 128 (Landroid/hardware/display/DisplayManager;) in Lorg/acra/collector/DisplayManagerCollector;

08-22 17:21:14.242: W/dalvikvm(29928): VFY: unable to resolve virtual method 2920: Landroid/view/Display;.getFlags ()I

08-22 17:21:14.242: W/dalvikvm(29928): VFY: unable to resolve virtual method 2932: Landroid/view/Display;.isValid ()Z

08-22 17:21:14.242: W/dalvikvm(29928): VFY: unable to resolve virtual method 2923: Landroid/view/Display;.getName ()Ljava/lang/String;

08-22 17:21:14.282: E/dalvikvm(29928): Could not find class 'android.provider.Settings$Global', referenced from method org.acra.collector.SettingsCollector.collectGlobalSettings

08-22 17:21:14.282: W/dalvikvm(29928): VFY: unable to resolve const-class 200 (Landroid/provider/Settings$Global;) in Lorg/acra/collector/SettingsCollector;


Anything I'm missing?

William Ferguson

unread,
Aug 23, 2016, 6:28:01 AM8/23/16
to acra-discuss
Yes, you shouldn't be included the ACRA jar.
You should be including the ACRA aar.

Note also that you should no longer be sending to a Google Docs spreadsheet.

William

Ashok Subedi

unread,
Aug 23, 2016, 10:11:56 AM8/23/16
to acra-discuss
But eclipse doesn't support ARR, so I unzipped and used the equivalent jar. I have very few clients so I won't be spamming google docs. So Google Docs doesn't work at all? 
Thank you so much for your response :)

Mark Murphy

unread,
Aug 23, 2016, 10:16:24 AM8/23/16
to acra-d...@googlegroups.com
On Tue, Aug 23, 2016, at 10:11, Ashok Subedi wrote:
> But eclipse doesn't support ARR, so I unzipped and used the equivalent
> jar.

There is more to an AAR than a JAR.

> I have very few clients so I won't be spamming google docs. So Google
> Docs
> doesn't work at all?

https://github.com/ACRA/acra/wiki/Notice-on-Google-Form-Spreadsheet-usage

"using Google Drive Forms as the ACRA reporting endpoint will not be
supported anymore"

That page lists various options for where to send your crash reports.

--
Mark Murphy (a Commons Guy)
https://commonsware.com | https://github.com/commonsguy
https://commonsware.com/blog | https://twitter.com/commonsguy

Ashok Subedi

unread,
Aug 23, 2016, 2:39:43 PM8/23/16
to acra-discuss


Thank you. I will use other options to Google docs. But how do I use AAR on eclipse? Stackoverflow suggests to unzip to Jar and use it. Any suggestions?

Mark Murphy

unread,
Aug 23, 2016, 2:43:53 PM8/23/16
to acra-d...@googlegroups.com
On Tue, Aug 23, 2016, at 14:39, Ashok Subedi wrote:
> But how do I use AAR on
> eclipse? Stackoverflow
> <http://stackoverflow.com/questions/21417419/how-to-convert-aar-to-jar/21485222#21485222>
> suggests to unzip to Jar and use it. Any suggestions?

Use an AAR-aware build system (Gradle, Maven) and an IDE to match.

F43nd1r

unread,
Aug 23, 2016, 4:16:05 PM8/23/16
to acra-discuss
While it is the preferred solution to use the aar, it is in fact possible to use the jar (again: it it highly discouraged to do so).
At the moment ACRA only uses one of the additional features of an aar, which is the AndroidManifest. If you copy the manifest entries in addition to the jar, it should work.
We don't support this usage and it might be broken in future releases without further notice.

However these errors look different from this problem anyway.
There are classes and methods missing on the classpath which should never be missing in the given scenario.
I know of 3 causes for this:
a) the device is no Android device (however this would probably lead to an earlier crash)
b) the device reports a wrong Build.VERSION.SDK_INT
c) the device runs a custom (and inherently broken) ROM

Ashok Subedi

unread,
Aug 23, 2016, 4:44:21 PM8/23/16
to acra-discuss
My app runs on Samsung galaxy tab 2 (10.1). I will try these solutions and keep  you guys posted. (I generated crash myself to test the application). The install is not from google play but my local debugging app (it should't be an issue right?). I haven't modified device.
Thank you so much for your help.


Reply all
Reply to author
Forward
0 new messages