Custom Android App Crashes

I have been working on this Android app and I’m running into an issue I can’t seem to figure out.

The app will occasionally crash with error java.lang.IllegalStateException but I can’t reproduce the crash easily.
Here are the full details:

Caused by: **java.lang.IllegalStateException** :
at (
at (
at com.example.DeviceListActivity.onCreate (
 Async.executeAsync(ParticleCloudSDK.getCloud(), new Async.ApiWork<ParticleCloud, ParticleDevice>() {
            public ParticleDevice callApi(@NonNull ParticleCloud ParticleCloud) throws ParticleCloudException, IOException {
                ParticleDevice device = ParticleCloud.getDevice(getIntent().getStringExtra(ARG_DEVICEID));

                return device;

            public void onSuccess(@NonNull ParticleDevice particleDevice) { // this goes on the main thread

                deviceNameView.setText(String.format("Name: %s", particleDevice.getName()));


            public void onFailure(@NonNull ParticleCloudException e) {

                Toaster.l(VariablesActivity.this, "Device Offline");

The crash seems to happen after I had the app running for some time, I rebooted the device in the meantime and I go back to open the app it crashes.

That stack trace should have included the error message from that exception:

"init not called before using the Particle SDK. Are you calling ParticleCloudSDK.init() in your Application.onCreate()?"

So... are you calling ParticleCloudSDK.init() in your Application.onCreate()? :slight_smile: