I recently upgraded React Native 0.63.4 to 0.70.1 and have been trying to iron everything out re upgrading packages and dependencies etc. I’m really stuck on this particular error and can’t seem to find a solution. The command prompt says: Task :app:processDebugMainManifest FAILED … FAILURE: Build completed with 2 failures. 1: Task failed with an exception. What went wrong: Execution
Tag: react-native
How to call a Java method from Javascript
How do you call a Java method/ function from Javascript? Java Function: Javascript Function: Answer To call java code from javascript in your react-native app, you have to create a module I suggest reading the docs: https://reactnative.dev/docs/native-modules-android Java code – android/app/src/main/java/com/your-app-name/JavaModule.java Register the Module – android/app/src/main/java/com/your-app-name/MyAppPackage.java To register the package change the getPackages method in this file: android/app/src/main/java/com/your-app-name/MainApplication.java JavaScript code
reactNative.Share.open is undefined
I’m trying to use the share component with react native but I keep getting this error below. Any idea why ? ‘_reactNative.Share.open is not a function. (In ‘_reactNative.Share.open({ url: uri })’, ‘_reactNative.Share.open’ is undefined)’ Answer This is because ‘Share.open()’ is now deprecated, use ‘Share.share()’ instead.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
I’m trying to use a physical Android device to test/debug my React Native project. I connected the device to my Windows 11 machine via USB and turned on Developer mode on the device but when I tried to run my project, I got an error stating the following: Android Gradle plugin requires Java 11 to run. You are currently using
React native ANDROID build fails with error in BasePackageList.java. varargs mismatch; ApplicationPackage cannot be converted to Package
I was using depcheck to uninstall unused modules from my project. I following three packages along with a few others that i installed during development. expo-status-bar expo-updates expo-splash-screen however after doing so, i encountered few errors during build, and thus i reinstalled these packages. but now I’m facing this error. I am sure that expo-application is installed Here is the
React native firebase crashes when using emulator
I’m struggling for a few days now on using firestore emulator in a react-native project Whenever the code reaches a firestore hit the application crash without any log (RN side). Now I know RNFirebase is well installed as I can hit firestore real server. I’ve checked the logcat and it gives me this error. Here is my packages.json And I
Cannot use yarn android after adding react navigation 6.x
So I’m using https://reactnavigation.org/docs/getting-started to make my navigation. I did the yarn add @react-navigation/native and yarn add react-native-screens react-native-safe-area-context. At this point my app is still fine even after restarting yarn start. The problem started after I add the code needed to MainActivity.java and from there the app won’t launch (it also won’t work even after wrapping it in NavigationContainer
react-native run-android does not work :/
Running react-native run-android in windows but get this error: I have installed android studio and created a project and I also run the emulator and i did Answer You could try this one react native environment setup from react native official documentation or this react native environment setup from tutorialspoint one
React native issue firebase messaging
I am trying to install the react native firebase messaging module to my project so I can remotely send notifications. When I built my app yarn android/react-native build-android I got an error in which I have been trying to fix for the last 3 hours. build.gradle: settings.gradle: MainApplication.java: Error/Output: Any help is greatly appreciated. Answer Add after => import com.facebook.react.ReactApplication;
Java Function Return to React-Native
I’m developing an application with an integration Smart-POS. My application is in React-Native and the card reading or printing options are created through Java functions. In other words, I’m calling a function in React-Native that is requesting a function in a Java file that communicates with the device and gives me a return. Problem: I’m not getting any return after