I have an app which fails on linking/unlinking packages, similar to this issue.
It specifically fails on linking the MainApplication.java
file with this error.
error Something went wrong while unlinking. Reason ENOENT: no such file or directory, open './AppName/android/app/src/main/java/co/AppName/AppName/MainApplication.java'
The path is actually incorrect java/co/AppNAme
should be java/com/AppName
.
I can't find anywhere what could be causing this or any documentation on how to set the path.
I've tried using babel-plugin-module-resolver
but no success, unless im missing something. Anyone had a similar problem?
On Android and iOS, it'll use React Native's Linking module to handle incoming links, both when the app was opened with the link, and when new links are received when the app is open. On the Web, it'll use the History API to sync the URL with the browser.
If you're integrating React Native into an existing project, you'll want to skip Expo CLI and go directly to setting up the native build environment. Select "React Native CLI Quickstart" above for instructions on configuring a native build environment for React Native.
You can also use a third-party CLI to init your React Native app, such as Ignite CLI. You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
If you want to be able to switch between different Node versions, you might want to install Node via nvm-windows, a Node version manager for Windows. React Native also requires Java SE Development Kit (JDK), which can be installed using Chocolatey as well. If you have already installed Node on your system, make sure it is Node 12 or newer.
TLDR: Adding another folder like so java/co/AppNAme/AppName/
will fix your issue.
After updating to the latest react-native I had this issue too. Your android path contains your apps ID so com.test.app path
should be android/app/src/main/java/com/test/app
.
You've stated;
The path is actually incorrect
java/co/AppNAme
should bejava/com/AppName
.
This isn't correct as looking at your error message, its actually telling you where its expecting the file to be;
no such file or directory, open
java/co/AppName/AppName/MainApplication.java
If you create another folder like so java/co/AppNAme/AppName/
it will fix your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With