Tag Archives: cannot be cast

React Native Publishing an Android App

How to fix com.myapp.MainApplication cannot be cast to com.facebook.react.ReactApplication

To fix this issue, thats happening when using react-native-push-notification package with Expokit, you will need to go into your android/src/main/java/host/exp/exponent and open up the MainApplication.java file. The file needs to be edited and changed, so you avoid any errors with getting push notifications. A sample file looks like this: package host.exp.exponent; import com.facebook.react.ReactPackage; import java.util.Arrays; […]