Closed successiveoverrelaxation closed 4 years ago
The exception is below: 2019-11-22 16:31:14.884 5609-5703/io.ionic.starter E/Capacitor/Plugin: error java.lang.NullPointerException: Attempt to get length of null array at java.lang.StringFactory.newStringFromBytes(StringFactory.java:209) at com.whitestein.securestorage.SecureStoragePlugin.get(SecureStoragePlugin.java:42) at java.lang.reflect.Method.invoke(Native Method) at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) at com.getcapacitor.Bridge$2.run(Bridge.java:526) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.os.HandlerThread.run(HandlerThread.java:65)
I was using the SecureStoragePlugin in an authguard and forgot to catch the error for when there is no item. The same code worked on iOS so I thought it was a bug, my mistake.
The NullPointerException caused a blank and unresponsive screen (after the splash screen) on a Nexus 4 API 27 emulator. This simple change resolved the issue.