Push Commander Revisited - Missing Class

Backendless Version (5.0.4, Online)
Client SDK (Android).
IDE: Android Studio 2021.2.1 Patch 1
Application ID: B97A5053-3CE3-9ECA-FFE9-A664C68A2A00

Expected Behavior: DeviceRegistrationResult is part of Backendless API / successful build

Please describe the expected behavior of the issue, starting from the first action.

  1. Trying to finish the Push Commander mission
  2. Trying to successfully compile mobile Android app to complete mission
  3. Expecting to avoid build error surrounding missing DeviceRegistrationResult class (without having to force use of blocking code)

Actual Behavior

com.backendless.push.DeviceRegistrationResult cannot be imported.

The build process indicates an error:
Cannot find symbol class : DeviceRegistrationResult
C:\Users\cobusvanzyl.smit\AndroidStudioProjects\AuthorizerOne\app\src\main\java\com\bha\authorizerone\MainActivity.java:61: error: cannot find symbol
new AsyncCallback() {
^
symbol: class DeviceRegistrationResult
location: class MainActivity

Reproducible Test Case: unknown - seems class is missing. I have checked all dependencies.

           Backendless.Messaging.registerDevice(channels,
            new AsyncCallback<DeviceRegistrationResult>() {
                @Override
                public void handleResponse(DeviceRegistrationResult response) {
                    Toast.makeText( getApplicationContext(), "Device registered!",
                    Toast.LENGTH_LONG).show();
                }

                @Override
                public void handleFault(BackendlessFault fault) {
                    Toast.makeText(getApplicationContext(), "Error registering " + fault.getMessage(), Toast.LENGTH_LONG).show();
                }
            });

Hello @Cobus_Smit

Please, provide the version of Android SDK. It would also be good if you could send us an archive of the project where the problem is reproduced. As I have with your code and SDK version 6.3.3 the problem does not reproduce.

Regards,
Inna

Hi there,

The Android SDK version is 11.0.

I also appear to have an issue with Android Studio picking up BackendlessFCMService in the manifest file. Strangely enough, this also sits in the push package (which also does not recognize the DeviceRegistrationResult).

Zipped project below:
AuthorizerOne.zip (22.5 MB)

Hello @Cobus_Smit

Unfortunately, I’m having trouble opening your project. But I saw that you are using an old version of the Backendless Android SDK. The current version is 5.0.4. Try using a later version such as 6.3.3.
Also, I’m adding my own project with working device registration.
Support_device_registration.zip (20.9 MB)

Regards,
Inna

Thanks Inna - I somehow managed to get it running without error. The Tutorial does not seem to let me move forward (i.e. the registration does not complete for some reason). I will keep investigating. For now I’m really hoping that PWA is on the horizon - the native approach is cumbersome.

1 Like