4

I'm trying to run uiautomatorviewer on Big Sur and I'm getting this error

java.lang.NullPointerException
    at org.eclipse.swt.widgets.Control.internal_new_GC(Unknown Source)
    at org.eclipse.swt.graphics.GC.<init>(Unknown Source)
    at org.eclipse.swt.graphics.GC.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Tree.computeSize(Unknown Source)
    at org.eclipse.swt.layout.GridData.computeSize(Unknown Source)
    at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
    at org.eclipse.swt.layout.GridLayout.computeSize(Unknown Source)
    at org.eclipse.swt.widgets.Composite.computeSize(Unknown Source)
    at org.eclipse.swt.custom.SashFormLayout.computeSize(Unknown Source)
    at org.eclipse.swt.widgets.Composite.computeSize(Unknown Source)
    at org.eclipse.swt.custom.SashFormLayout.computeSize(Unknown Source)
    at org.eclipse.swt.widgets.Composite.computeSize(Unknown Source)
    at org.eclipse.swt.layout.FillData.computeSize(Unknown Source)
    at org.eclipse.swt.layout.FillLayout.computeChildSize(Unknown Source)
    at org.eclipse.swt.layout.FillLayout.computeSize(Unknown Source)
    at org.eclipse.swt.widgets.Composite.computeSize(Unknown Source)
    at org.eclipse.swt.layout.GridData.computeSize(Unknown Source)
    at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
    at org.eclipse.swt.layout.GridLayout.layout(Unknown Source)
    at org.eclipse.swt.widgets.Composite.updateLayout(Unknown Source)
    at org.eclipse.swt.widgets.Composite.updateLayout(Unknown Source)
    at org.eclipse.swt.widgets.Composite.layout(Unknown Source)
    at org.eclipse.swt.widgets.Display.runSettings(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at com.android.uiautomator.UiAutomatorViewer.main(UiAutomatorViewer.java:78)
4
  • Can you please share the code that is throwing that error?
    – Mate Mrše
    Dec 15, 2020 at 10:34
  • I'm running uiautomatorviewer so that it launches the GUI so that I can inspect the UI of an Android emulator.
    – Noldy
    Dec 15, 2020 at 10:45
  • @Noldy, were you able to resolve this? I found others having issues with tools using SWT on BigSur. Seems like could be 32bit support related: forum.portfolio-performance.info/t/….. Jan 2, 2021 at 20:59
  • i have the same problem Jan 6, 2021 at 6:44

1 Answer 1

0

This question appears to be the same issue that you were seeing. I followed this answer, which was to download the latest SWT Binary and Source release from the Eclipse Project, extract it, rename swt.jar to swt2.jar, and copy it to ~/Library/Android/sdk/tools/lib/x86_64/swt2.jar.

This workaround was originally suggested in this issue report. One person said they also had to copy it to ~/Library/Android/sdk/tools/lib/x86/swt2.jar, but I did need to do that.

In my case, I downloaded the 4.19 Mac OSX (64 bit version) release for my (non-ARM) MacBook Pro. You can find other releases on the Eclipse Project Downloads page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.