Skip to content
Advertisement

Android: error: cannot find symbol packages.add(new MyAppPackage())

Please HELP!!

I’m working on an app in react-native that involves using a native Calendar module. I’m trying to register this module with react native and I keep getting this error. enter image description here

This is how I’ve registered the module in MainApplication.java:

JavaScript

This is the MyAppPackage.java file I’ve created using the tutorial here, https://reactnative.dev/docs/native-modules-android#register-the-module-android-specific.:

JavaScript

Note: This app was previously created using the managed-workflow on expo and was ejected to the bare workflow. This is the directory for the relevant files:

enter image description here

Advertisement

Answer

Is this as simple as an import problem?

I noticed your MyAppPackage class is defined here:

JavaScript

But your MainApplication error message seems indicate a sub-package, specifically “chowtime.chowtime”. Did you mean for both chowtimes?

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement