title: React Native run-android error, cannot find symbol
body: <p>I'm trying to make Notifications for android using NotificationCompat, i'm stuck on a problem where i get "error: cannot find symbol".
  This is my NotificationService.java file.
  I'm thinking that maybe the error comes from importing, but I'm not sure, stuck on this problem for long time :(</p>
  
  <pre><code>package com.notifikacijas;
  import android.util.Log;
  import android.widget.Toast;
  
  import android.content.Context;
  import android.content.Intent;
  import android.app.NotificationManager;
  import android.app.NotificationChannel;
  import android.app.Notification;
  import android.app.PendingIntent;
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
  import android.os.Build;
  import androidx.core.app.NotificationCompat;
  import androidx.core.app.NotificationManagerCompat;
  import androidx.core.app.NotificationCompat.Builder;
  
  public class NotificationService extends ReactContextBaseJavaModule {
    private ReactApplicationContext reactContext;
  
    public NotificationService(ReactApplicationContext reactContext) {
      super(reactContext);
      Log.i("NotificationService", "NotificationService Constructor");
      this.reactContext = reactContext;
      String CHANNEL_ID = "Kanaals";
      NotificationCompat.Builder = new NotificationCompat.Builder(this.reactContext, CHANNEL_ID)
      .setContentTitle("Virsraksts")
      .setContentText("Teksts");
    }
  
    @Override
    public String getName() {
      return "NotificationService";
    }
  }
  </code></pre>
  
  <p>And there goes MainApplication.java</p>
  
  <pre><code>package com.notifikacijas;
  
  import android.app.Application;
  import android.content.Context;
  import com.facebook.react.PackageList;
  import com.facebook.react.ReactApplication;
  import com.github.amarcruz.rnlog.RNLogPackage;
  import com.facebook.react.ReactNativeHost;
  import com.facebook.react.ReactPackage;
  import com.facebook.soloader.SoLoader;
  import java.lang.reflect.InvocationTargetException;
  import java.util.List;
  
  public class MainApplication extends Application implements ReactApplication {
  
    private final ReactNativeHost mReactNativeHost =
        new ReactNativeHost(this) {
          @Override
          public boolean getUseDeveloperSupport() {
            return BuildConfig.DEBUG;
          }
  
          @Override
          protected List&lt;ReactPackage&gt; getPackages() {
            @SuppressWarnings("UnnecessaryLocalVariable")
            List&lt;ReactPackage&gt; packages = new PackageList(this).getPackages();
            // Packages that cannot be autolinked yet can be added manually here, for example:
            packages.add(new NotificationService());
            return packages;
          }
  
          @Override
          protected String getJSMainModuleName() {
            return "index";
          }
        };
  
    @Override
    public ReactNativeHost getReactNativeHost() {
      return mReactNativeHost;
    }
  
    @Override
    public void onCreate() {
      super.onCreate();
      SoLoader.init(this, /* native exopackage */ false);
      initializeFlipper(this); // Remove this line if you don't want Flipper enabled
    }
  
    /**
     * Loads Flipper in React Native templates.
     *
     * @param context
     */
    private static void initializeFlipper(Context context) {
      if (BuildConfig.DEBUG) {
        try {
          /*
           We use reflection here to pick up the class that initializes Flipper,
          since Flipper library is not available in release mode
          */
          Class&lt;?&gt; aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
          aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
        } catch (ClassNotFoundException e) {
          e.printStackTrace();
        } catch (NoSuchMethodException e) {
          e.printStackTrace();
        } catch (IllegalAccessException e) {
          e.printStackTrace();
        } catch (InvocationTargetException e) {
          e.printStackTrace();
        }
      }
    }
  }
  </code></pre>
  
  <p>This is my console error output.</p>
  
  <pre><code>/home/arturo/Notifikacijas/android/app/src/main/java/com/notifications/NotificationService.java:18: error: cannot find symbol
    private ReactApplicationContext reactContext;
            ^
    symbol:   class ReactApplicationContext
    location: class NotificationService
  /home/arturo/Notifikacijas/android/app/src/main/java/com/notifications/NotificationService.java:20: error: cannot find symbol
    public NotificationService(ReactApplicationContext reactContext) {
                               ^
    symbol:   class ReactApplicationContext
    location: class NotificationService
  /home/arturo/Notifikacijas/android/app/src/main/java/com/notifications/NotificationService.java:25: error: cannot find symbol
      NotificationCompat.Builder = new NotificationCompat.Builder(this.reactContext, CHANNEL_ID)
                        ^
    symbol:   variable Builder
    location: class NotificationCompat
  /home/arturo/Notifikacijas/android/app/src/main/java/com/notifikacijas/MainApplication.java:28: error: constructor NotificationService in class NotificationService cannot be applied to given types;
            packages.add(new NotificationService());
                         ^
    required: ReactApplicationContext
    found: no arguments
    reason: actual and formal argument lists differ in length
  </code></pre>
  
  <p>Looking forward for some help, thanks :)
  react-native: 0.61.5</p>
  
  <p>EDIT ::
  Fixed that, now after adding displayNotification(), it builds without errors, but keeps saying NotificationApp stopped working when i try to launch it.</p>
  
  <pre><code>  public void displayNotification() {
    Intent intent = this.reactContext.getPackageManager().getLaunchIntentForPackage("lv.dtg");
  
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  
    Uri uri = intent.getData();
  
    Log.i("NotificationService", "URI "+uri.toString());
    PendingIntent pendingIntent = PendingIntent.getActivity(this.reactContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
    String CHANNEL_ID = "notificationsChannel";
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this.reactContext, CHANNEL_ID);
    // builder.setSmallIcon(17301575);
    builder.setContentTitle("Objektā atrodas darbinieki");
    builder.setContentText("Vai vēlaties izreģistrēt darbiniekus no objekta?");
    builder.setPriority(NotificationCompat.PRIORITY_DEFAULT);
    builder.setContentIntent(pendingIntent);
    // builder.setAutoCancel(false);
  
    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this.reactContext);
    notificationManager.notify(123, builder.build());
    }
  </code></pre>