Build React Native App (Android) Fail

Hello there!

I am having a lot of trouble trying to create build for my RN app, for Android.

I’m using Expo Application Services to build but it seems like something about backendless isn’t letting the app create a build. The error log list goes even longer but here’s some :

> Task :backendless-react-native:generateReleaseRFile
> Task :backendless-react-native:javaPreCompileRelease
> Task :backendless-react-native:compileReleaseJavaWithJavac FAILED
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessModule.java:8: error: package android.support.annotation does not exist
[stderr] import android.support.annotation.NonNull;
[stderr]                                  ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessModule.java:9: error: package android.support.annotation does not exist
[stderr] import android.support.annotation.Nullable;
[stderr]                                  ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessModule.java:10: error: package android.support.annotation does not exist
[stderr] import android.support.annotation.RequiresApi;
[stderr]                                  ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:21: error: package android.support.annotation does not exist
[stderr] import android.support.annotation.RequiresApi;
[stderr]                                  ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:22: error: cannot find symbol
[stderr] import android.support.v4.app.NotificationCompat;
[stderr]                              ^
[stderr]   symbol:   class NotificationCompat
[stderr]   location: package android.support.v4.app
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:23: error: cannot find symbol
[stderr] import android.support.v4.app.RemoteInput;
[stderr]                              ^
[stderr]   symbol:   class RemoteInput
[stderr]   location: package android.support.v4.app
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:145: error: package NotificationCompat does not exist
[stderr]     private NotificationCompat.Builder createNotification(NotificationChannel notificationChannel) {
[stderr]                               ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:150: error: package NotificationCompat does not exist
[stderr]     private NotificationCompat.Builder createNotification(RNBackendlessPushNotificationMessage pushMessage) {
[stderr]                               ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:162: error: package NotificationCompat does not exist
[stderr]     private void setPriority(RNBackendlessPushNotificationMessage pushMessage, NotificationCompat.Builder notification) {
[stderr]                                                                                                  ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:186: error: package NotificationCompat does not exist
[stderr]     private void setVibrate(RNBackendlessPushNotificationMessage pushMessage, NotificationCompat.Builder notification) {
[stderr]                                                                                                 ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:195: error: package NotificationCompat does not exist
[stderr]     private void setCancellations(RNBackendlessPushNotificationMessage pushMessage, NotificationCompat.Builder notification) {
[stderr]                                                                                                       ^
[stderr] /root/.nvm/versions/node/v14.15.1/lib/node_modules/@expo/eas-build-worker/workingdir/build/node_modules/backendless-react-native/android/src/main/java/com/reactlibrary/RNBackendlessPushNotificationHelper.java:258: error: package NotificationCompat does not exist

Thank you in advance!

Hello @Diogo_Potes

Could you please provide us with a sample reproducible project?

Regard, Viktor

Hello!

I can give you access on GitHub. What’s your name there?

Hi @Diogo_Potes

Do you follow the steps described here? If so, at what point the error appears?

Best Regards,
Maksym

Hello!

I mean, yes… but there are things I didn’t do, for example, writing code for subscription of Push Notifications or Delievered Notifications because I didn’t want to implement that on my App… Is that necessary anyway though?

I only did the register device feature, the Android setup with Firebase and this part to setup the project:

import { Platform } from 'react-native';
import Backendless from 'backendless';
import 'backendless-react-native';

const APP_ID = 'YOUR_APP_ID';

const API_KEY = Platform.select({
  ios    : 'YOUR_IOS_API_KEY',
  android: 'YOUR_ANDROID_API_KEY'
});

Backendless.initApp(APP_ID, API_KEY);

Do i need to do more steps?
Thank you and regards.

The Push Notifications setup is not necessary.

Make sure to:

  1. Install the library

     npm i backendless backendless-react-native -S
    
  2. Link Native Modules

     react-native link
    
  3. And initialize the Backendless like you did.

If the issue still persists, can you please share your project?

1 Like

Thank you for reply.

Instead of creating build with EAS, I went in an alternative (traditional) way… I created my bundle and published it in the Play Store and there was no error so, I think everything is fine now.

Thank you and regards.

Glad it works for you!